I have a door open/closed sensor connected to an ESP8266 running Espeasy, data is being send via mqtt, and the hass receives it, i can properly see the sensor state in the UI:
Following automation to turn on a specific light when the door sensor is on is not working, also tried multiple variations after browsing this forum and the web… :-o
automation:
- alias: Licht an im Spint bei offener Tür
trigger:
- platform: state
entity_id: binary_sensor.spinttur
to: 'on'
from: 'off'
action:
- service: light.turn_on
entity_id: light.dimmable_light_1
Also your sensor name is Spinttür but your entity id is spinttur
I dont know how HA handles the punctuation but make sure you copied your binary sensor from the states panel. Also try renaming it to something without punctuation.
Also use quotes on your alias:
- alias: 'Licht an im Spint bei offener Tür'
Can you manually trigger the automation using the services panel? Does it work?
The reason you had no automation is probably because your automation wasnt working due to the quotes on the alias. Try again if you can see your automation.
Go to the dev panel on the left-bottom and click the first icon called “services”
At the service text box, type automation.trigger and below at the entity find your automation which should look something like this: automation.Licht_an_im_Spint_bei_offener_Tur
The service data will be auto completed. Dont touch it.
Click Call service
Tell us what happened after calling the service.
EDIT: Dont forget to go to the configuration and click CHECK CONFIG
if it passes the check, then click the reload automations button
Just saw that warning in the homeassistant journal/log: YAML file /home/homeassistant/.homeassistant/configuration.yaml contains duplicate key "sensor". Check lines 39 and 64.
I had added the automation directly to the configuration.yaml, but at the very end an automations.yaml was included as automation.
Sorry to have stolen your time, but at least a learned couple of bits!