Não estou a conseguir efectuar o controle através do nível da luz, nem se esta a desligar ao fim de 1 minuto, que estou a fazer mal???
automation:
- alias: 'alarme telegram porta rua'
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d00022b9f67
to: 'on'
action:
- service: notify.telegram
data:
title: "Alarme"
message: "porta da rua"
- alias: 'alarme telegram movimento pir1'
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d0001e0af13
to: 'on'
action:
- service: notify.telegram
data:
title: "Alarme"
message: "sensor de movimento pir1"
- alias: Alerta telegram Para Substituir a Bateria dos Sensores
initial_state: 'on'
trigger:
platform: numeric_state
entity_id:
- sensor.pir1_battery_level
- sensor.p_da_rua_battery_level
below: 4
condition:
- condition: template
value_template: '{{ states.input_boolean.battery_notifications.state == "on" }}'
action:
- service: notify.telegram
data_template:
message: 'Alerta! {{ trigger.from_state.attributes.friendly_name }} necessita de ser substituída, apenas tem {{ trigger.from_state.state }}% de bateria restante!!'
##### TECTO FALSO ####
- alias: Automatico Luz Tecto Falso
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d0001e0af13
from: 'off'
to: 'on'
# condition:
# condition: numeric_state
# entity_id: sensor.illumination_158d0001e0af13
# below: 300
action:
- service: switch.turn_on
entity_id: switch.Luz_Tecto_Falso
- service: automation.turn_on
data:
entity_id: automation.MOTION_OFF
- alias: If there no motion for 5 minutes turn off the gateway light
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d0001e0af13
from: 'on'
to: 'off'
for:
minutes: 1
action:
- service: switch.turn_off
entity_id: switch.Luz_Tecto_Falso
- service: automation.turn_off
data:
entity_id: automation.Motion_off