Skip to content

Instantly share code, notes, and snippets.

@Udinic
Last active November 2, 2025 15:47
Show Gist options
  • Select an option

  • Save Udinic/dd0198f7b6b6fc5699ca6cc5079ad70f to your computer and use it in GitHub Desktop.

Select an option

Save Udinic/dd0198f7b6b6fc5699ca6cc5079ad70f to your computer and use it in GitHub Desktop.
esphome:
name: cardflix-scanner
friendly_name: CardFlix
min_version: 2024.11.0
name_add_mac_suffix: false
esp8266:
board: d1_mini
improv_serial:
# Define buttons for writing tags via HA
button:
- platform: restart
name: "${friendly_name} Restart"
entity_category: config
i2c:
scan: False
frequency: 400kHz
globals:
- id: source
type: std::string
- id: url
type: std::string
- id: info
type: std::string
pn532_i2c:
id: pn532_board
on_tag:
then:
- logger.log: "Tag scanned"
- delay: 0.25s
- lambda: |-
id(source)="uid";
- if:
condition:
lambda: 'return ( id(source)=="uid" );'
then:
- homeassistant.tag_scanned: !lambda |-
return x;
binary_sensor:
- platform: status
name: "${friendly_name} Status"
entity_category: diagnostic
# Enable logging
logger:
# level: VERY_VERBOSE
# level: VERBOSE
# Enable Home Assistant API
api:
# Enable OTA upgrade
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
web_server:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment