I have created an automation to turn on the lights at sunset. That part does work. And another to turn of the lights later in the evening. The light do never turn off, or much to late.
I thought I could create a time trigger in a pattern, every 5 minutes from 23:00-2:00 o’clock. And a condition like: No motion detected in a certain time period. And then action … I created a notify to check when and if the automation is triggered.
Half an hour after we went upstairs, the lights where still on, so I put them off. This morning I noticed a message that the script was triggered at: 3:55.
How is this working? Could someone advise me in this and with this script?
alias: Woonkamer verlichting Uit
description: ''
trigger:
- platform: time_pattern
hours: '23'
minutes: /5
- platform: time_pattern
hours: '0'
minutes: /5
- platform: time_pattern
hours: '01'
minutes: /5
condition:
- condition: and
conditions:
- type: is_no_motion
condition: device
device_id: 4fb6ad16f95aa4c48aff4db2f8a6d381
entity_id: binary_sensor.motion_sensor_voorhuis_motion_sensor_status
domain: binary_sensor
for:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- type: is_no_motion
condition: device
device_id: fd77e27895471e53828f69afec12731f
entity_id: binary_sensor.motion_sensor_achterhuis_motion_sensor_status
domain: binary_sensor
for:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- type: is_no_motion
condition: device
device_id: 3773fa4a3123bd88d921002c9149f735
entity_id: binary_sensor.motion_sensor_keuken_motion_sensor_status
domain: binary_sensor
for:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
action:
- service: notify.domoticzbot
data:
message: De lichten uit Woonkamer geactiveerd!
title: HomeAssistant woonkamerverlichting
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 69f411b2fb4623a436347e24be63d3c1
entity_id: switch.lamp_voorhuis_pp_switch
domain: switch
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- type: turn_off
device_id: d59ed76543d2f3c5a1135b654241554d
entity_id: light.philips_hue_staande_lamp
domain: light
- delay:
hours: 0
minutes: 2
seconds: 0
milliseconds: 0
- type: turn_off
device_id: e4caaa67b10f435f7cca09d7d2ff3dae
entity_id: light.philips_hue_bol
domain: light
- delay:
hours: 0
minutes: 3
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 7dc96f21eab74dcdcfd8ea6b7080766d
entity_id: light.philips_hue_led_strip_keuken
domain: light
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 7f282181b987c2f43747de9b5ff05e1b
entity_id: light.lamp_mug_dimmer_dimmer
domain: light
- delay:
hours: 0
minutes: 0
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 7a014d0596e1e39bce465c3a0cd2ad9f
entity_id: switch.lamp_openslaande_deuren_switch
domain: switch
- type: turn_off
device_id: 24e0844b40a7a276f1c135072d7e0e70
entity_id: switch.lamp_eettafel_switch
domain: switch
- type: turn_off
device_id: 12a580facc12ebe231a3e5465ae4f3d1
entity_id: switch.ijsblok_lampje
domain: switch
- type: turn_off
device_id: ba5a2e0b9584e547d2a98e07a8b7a397
entity_id: switch.lamp_voordeur_switch_1
domain: switch
mode: single
max: 10
I created this code in GUI. Home-assistant in docker. core-2021.9.7
These are all Zwave devices controlled by ZwaveJS2MQTT in seperated docker. Which works well.
Happy to learn from you!