esphome: includes: - wiegand_device.h name: rfid-verksted platform: ESP8266 board: d1_mini wifi: ssid: "ssid" password: "pwd" captive_portal: logger: api: ota: light: - platform: status_led name: "LED" pin: number: D4 #inverted: true internal: true sensor: - platform: custom lambda: |- auto wiegand = new WiegandReader(D1, D2); App.register_component(wiegand); return {wiegand}; sensors: name: "RFID Verksted" on_value: then: - homeassistant.tag_scanned: !lambda |- char buf[16]; sprintf(buf, "%.0f", x); std::string s = buf; std::string y = "Verksted: " + s; return y; switch: - platform: gpio id: "beep" pin: D3 inverted: yes internal: true - platform: template name: "Denied beep Verksted" icon: "mdi:bell-alert" id: long_beep turn_on_action: - switch.turn_on: beep - delay: 100ms - switch.turn_off: beep - delay: 100ms - switch.turn_on: beep - delay: 100ms - switch.turn_off: beep - delay: 100ms - switch.turn_on: beep - delay: 100ms - switch.turn_off: beep - delay: 100ms - switch.turn_on: beep - delay: 100ms - switch.turn_off: beep - switch.turn_off: long_beep - platform: template name: "Granted beep Verksted" icon: "mdi:bell-alert-outline" id: two_beep turn_on_action: - switch.turn_on: beep - delay: 100ms - switch.turn_off: beep - switch.turn_off: two_beep