Pulse Button Swith Help pls

I’m starting my first setup on HA.

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? :frowning:
(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.

thanks in advance

Hi :wave:!

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: Open your Home Assistant instance and show your state developer tools.

What does your door exactly expect to receive over the knx bus?

thanks for quick response farmio.

Yeah I prefer read the docs and started by there.

My door expects to receive a pulse on during 1s and then an Off

Ah, once properly formatted its much easier to spot the errors :+1: Try:

See holding state triggers and actions. Spacing and - matter a lot here, you’ll get the hang of it…

1 Like

farmio many many thanks. Worked.

thinking the time i lost with this issue :slight_smile:

:+1:
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.

In my case it is done by the KNX touchscreen button functions.

Hold 1 and release 0

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.

Yes…no issues about that. Thanks.

Lurgee, could you help another newbie out ?
I managed to put the switch in the Yaml file. but when i enter the automation it says that it is invalid

thanks for your help