I tried every combination, but it won’t work…
I want if the light’s are off, but only at night, to turn on the lights if the motion sensor detects.
Here is my automations.yaml
- id: tuinlichtPIR
alias: Tuinlicht aan bij beweging in poort
trigger:
- platform: state
entity_id: binary_sensor.pir_poort_1
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: '19:00:00'
- condition: sun
before: sunrise
action:
service: switch.turn_on
entity_id: switch.rfx_tuinlicht
When I change the condition to:
condition: time
after: '19:00:00'
then it works, but when I try to make the combination with the sun, nothing.
But I not sure if I understand how it works. I just read that the time can be: after 19:00 untill before 5:00. (So during the night)
Is: “before sunrise” the same as: 00:00 untill sunrise?
- id: tuinlichtPIR
alias: Tuinlicht aan bij beweging in poort
trigger:
- platform: state
entity_id: binary_sensor.pir_poort_1
to: 'on'
condition:
condition: or
conditions:
- condition: time
after: '19:00:00'
- condition: sun
before: sunrise
action:
service: switch.turn_on
entity_id: switch.rfx_tuinlicht