Can someone help me find my missing entity?
I have an ESPHome device (A Sonoff Basic switch) that has been working for weeks. Today, I can edit and update it in the ESPHome panel. I can open the device web page and turn the switch on or off. But an automation that turns this switch on or off stopped working. While investigating to see if the device developed a new entity_2 ID, I can’t find it in Developer Tools → states:
When turning the switch on/off from the device web page, I see this in the logs:
[12:50:10][D][switch:012]: 'basement_sconces relay' Turning ON.
[12:50:10][D][switch:055]: 'basement_sconces relay': Sending state ON
[12:50:17][D][switch:016]: 'basement_sconces relay' Turning OFF.
[12:50:17][D][switch:055]: 'basement_sconces relay': Sending state OFF
Yes, I’ve restarted Home Assistant. Any ideas would be appreciated.
Here is the YAML file of the device:
#basement-sconces.yaml
#Sonoff Basic RfR2 Module
substitutions:
device_name: basement-sconces
friendly_name: basement_sconces #Dashes are not allowed
packages:
device_base: !include common/esp8266.yaml
wifi: !include common/wifi.yaml
# Web server uses a lot of RAM. If you have a lot of components and your
# device is acting strange, remove the Web Server by uncommenting this line.
# web_server: !remove
###############################
# Sonoff Basic peripherals
# Relay on GPIO12
switch:
- platform: gpio
name: ${friendly_name} relay
pin:
number: 12
mode: output
id: relay
# Physical Button on GPIO0
binary_sensor:
- platform: gpio
pin:
number: 0
inverted: False
mode: INPUT_PULLUP
name: ${friendly_name} button_0
on_press:
- switch.toggle: relay
# Physical Button on GPIO3 (Rx)
- platform: gpio
pin:
number: 3
inverted: False
mode: INPUT_PULLUP
filters:
- delayed_on: 250ms # DEBOUNCE
name: ${friendly_name} button_3
#If the switch on GPIO3 is a toggle, use both on_press and on_release
#If the switch on GPIO3 is a momentary toggle, then just use on_press.
on_press:
then:
- switch.toggle: relay
on_release:
then:
- switch.toggle: relay
light:
- platform: status_led
name: ${device_name} status LED
id: ready
pin: GPIO13
internal: true
===========================================================
Update: I renamed the device and the new entity became available:
#basement-sconces.yaml
#Sonoff Basic RfR2 Module
substitutions:
device_name: basement-sconce-lights
friendly_name: basement_sconce_lights #Dashes are not allowed
I updated the automations with the new entity and they work fine.
But, still, why did the device entity disappear in the first place?