Hello, I’m Trying to transfer an automation from Nodered to Homeassistant automations.
This is to turn on a light after sunset till 02:00 (AM). But it’s not working. By Traces it stops at the time condition. Why?
alias: Luz Cozinha Movimento Before2
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.cozinha_occupancy
to: "on"
- platform: state
entity_id:
- binary_sensor.cozinha_pir
to: "on"
condition:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.luzes_cozinha_auto
state: "on"
- condition: sun
after: sunset
after_offset: "-00:15:00"
- condition: time
before: "02:00:00"
action:
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.int2cozinha1
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- service: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.int2cozinha1
mode: single