#Why doesn't this automation work?

1 messages · Page 1 of 1 (latest)

pseudo prawn
#

Desired automation => Turn on a light after sunset (when it's of) if someone came through the gate and next opens the backdoor. This is what I came up with, but this automation doesn't work (have absolutely no clue why it doesn't work???)

alias: Zet licht aan na poort en deur
description: >-
Zet het licht aan nadat de poort sensor is geactiveerd en daarna de deur
sensor binnen 3 minuten.
triggers:

  • type: opened
    device_id: 5301ba3796c4fac171ad67d609cb8636
    entity_id: d961279e26574f58304e784970b4a639
    domain: binary_sensor
    trigger: device
    conditions:
  • condition: template
    value_template: >
    {{ (as_timestamp(now()) -
    as_timestamp(states.binary_sensor.deursensor_poort_tuin.last_changed)) <=
    180 }}
  • condition: sun
    after: sunset
  • condition: device
    type: is_off
    device_id: 9cdc936b9b20e89b14caaae84b51d52b
    entity_id: 6ed79fa0f29671eae911231cd9ce59e1
    domain: switch
    actions:
  • type: turn_on
    device_id: 9cdc936b9b20e89b14caaae84b51d52b
    entity_id: 6ed79fa0f29671eae911231cd9ce59e1
    domain: switch
    mode: single

Can someone tell my why this doesn't work?

cloud cypress
#

please edit your post so it uses proper code tags. it's kinda unreadable like this

cold vineBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.