I know this is an old topic, but i hope someone can help me.
I try to get the doorsensor working, but i don’t know what goes wrong.
The goal is to turn on the light when door opens, en turn off when the door closes.
This is the code i added to configuration.yaml
# configuration for RFlink
rflink:
port: /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
logger:
default: error
# add the following to the existing logger section
logs:
rflink: debug
homeassistant.components.rflink: debug
light:
# add the following to the existing light section
- platform: rflink
automatic_add: true
sensor:
# add the following to the existing sensor section
- platform: rflink
automatic_add: true
binary_sensor:
- platform: rflink
devices:
ev1527_0e0fb0_0a:
name: Deur Hal Open
off_delay: 1
ev1527_0e0fb0_0e:
name: Deur Hal Closed
off_delay: 1
input_boolean:
my_door_sensor_hal:
This is the code i added to automation.yaml
alias: update_my_door_sensor_hal
description: ""
trigger:
- platform: state
entity_id: binary_sensor.deur_hal_open
from: "off"
to: "on"
- platform: state
entity_id: binary_sensor.deur_hal_closed
from: "off"
to: "on"
action:
- service: >-
input_boolean_turn_{% if trigger.to_state.object_id.split('_')[2] ==
'0a'%}on{%else%}off{%endif%}
data:
entity_id: input_boolean.my_door_sensor_hal
But how can i put on the light?
I added the following automation, but it doesn’t work
alias: lamp aan
description: ""
trigger:
- platform: state
entity_id:
- input_boolean.my_door_sensor_hal
from: "off"
to: "on"
condition: []
action:
- service: light.turn_on
data: {}
target:
entity_id: light.verlichting_hal_toilet
mode: single
I hope somebody can help me.