Quiero conseguir que al abrir la puerta el gateway se ilumine en un color determinado (rojo) aunque el color no es importante, y al cerrar la puerta se apague el gateway. Al mismo tiempo quiero que cuando se abra la puerta tambien active el enchufe (lampara) durante 3 minutos y pasado ese tiempo se apague.
En MiHome funciona asi, cuando se conecta con los servidores, claro
Tengo el codigo siguiente pero no me hace lo que quiero,
Código: Seleccionar todo
- id: '1540230613932'
alias: Puerta Abierta
trigger:
- entity_id: binary_sensor.door_window_sensor_ababababababa
platform: state
condition:
- condition: state
entity_id: binary_sensor.door_window_sensor_ababababababa
state: 'on'
action:
- service: light.turn_on
entity_id: light.gateway_light_34cezzzz1234
data_template:
rgb_color: [255,85,0]
brightness: 255
- service: switch.turn_on
entity_id: switch.plug_34cezzzz1234
- delay: '00:00:03'
- service: light.turn_off
entity_id: light.gateway_light_34cezzzz1234
- service: switch.turn_off
entity_id: switch.plug_34cezzzz1234
- delay: '00:03:00'
- data:
message: "Puerta Piso abierta \U0001F6AA"
service: notify.telegram
Código: Seleccionar todo
- id: '1540230613932'
alias: Puerta Abierta
action:
- service: light.turn_on
entity_id: light.gateway_light_34cezzzz1234
data_template:
rgb_color: [255,85,0]
brightness: 255
- service: switch.turn_on
entity_id: switch.plug_158dxxxxxxabcd
- delay: '00:00:03'
- service: light.turn_off
entity_id: light.gateway_light_34cezzzz1234
- service: switch.turn_off
entity_id: switch.plug_34cezzzz1234
- delay: '00:03:00'