@DaveUK83 wrote:
Hi,
I’ve managed to create it so that a scene is activated when a door is opened during a certain time, however I can’t seem to get it to work to turn the lights off when the door is closed. This is my current code:alias: Bedroom Door Closed description: Night closing for bathroom trigger: - entity_id: binary_sensor.bedroom_door_contact from: 'on' platform: state to: 'off' condition: - after: '16:00:00' condition: time - condition: and conditions: - before: sunrise before_offset: '+20:00' condition: sun action: - data: entity_id: scene.bathroom_bedroom service: homeassistant.turn_off
I use scene.turn_on as the service to activate the scene, however can’t find what to use to turn off. I tried homeassistant.turn_off, but no joy.
Any help appreciated.
Posts: 16
Participants: 4