already have some KNX devices working. but i’m struggling now to create a pulse switch.
Have some doors with electric pulses (main door, garage door, street door, etc) and have read and watched some videos for
this kind of triggers in HA and I have no more ideas what is wrong:
I have this yaml:
#" SWITCHs "#
- name: "Main Door"
address: "1/0/10"
state_address: "1/0/100"
#" TRIGGERS "#
automation:
- trigger:
platform: state
entity_id: switch.main_door
to: "on"
# If given, will trigger when state has been the to state for X time.
for: "00:00:01"
action:
`- service: switch.turn_off
entity_id: switch.main_door
what is wrong here?
(it has a space between “- trigger” and “- service”)
first i can’t understand how the trigger knows the switch entity_id, but if I try to add it in the UI it appears as switch.main_door, so.
Already tried to put an entity_id in the switch but it raises an error while chekhing the yaml file.
I would recommend reading the Knx documentation over watching videos - HA and the knx Integration change quite fast - the docs are (should be) always up to date.
Second: please use code tags (backticks ` for inline or tripple ``` for multiline) for code and yaml (or the UI editors Code button).
entity_id is a sluggified version of the name. You can change it from UI once an entity is created. You can see it in the cogwheel menu of an entities detail view or all of them here:
What does your door exactly expect to receive over the knx bus?
be aware that this sends the “OFF” telegram also if the “ON” didn’t come from HA but somewhere else on your bus. In knx such things are often done directly in the actuators config with timers / staircase light functions.
So if you hold longer than 1sec HA will send an OFF telegram and when you release the button will send another. Just make sure this doesn’t cause problems.