Been at this for a couple of hours now, but I can’t figure out why it is not working.
I’m trying to get a door sensor to turn on a light.
It looks like this:
id: ‘1560367756411’
alias: Test 1
trigger:
entity_id: binary_sensor.openclose_29
from: closed
platform: state
to: open
action:
For future reference, please format your code to make it easier for others to read. For example:
- id: '1560367756411'
alias: Test 1
trigger:
platform: state
entity_id: binary_sensor.openclose_29
from: 'off'
to: 'on'
action:
service: switch.turn_on
data:
entity_id: switch.uttag_vardagsrum
Use the formatting icon </> in the tool bar or enter three consecutive back-quotes ``` on a separate line before your code and then another three on a separate line after your code.
I had already tried on/off state several times, but I had missed I had to put the state between ’ ’
I actually used the automation-tool provided in hass.io, but I guess I messed it up somehow…
Thank you all, and I’ll keep the formatting tool in mind for further pastes of code.