Hi guys,
Is there a way to reset a Button card in Lovelace when it’s pressed?
I have a dooropener and I need to tap it twice that it goes back to the “off” state.
Hi guys,
Is there a way to reset a Button card in Lovelace when it’s pressed?
I have a dooropener and I need to tap it twice that it goes back to the “off” state.
What exactly do you have configured? An Entity Button Card?
Exactly.
The mechanic behind the door opener is that If i trigger the physical switch (which acts like a toggle or button not sure about the English word) the door opens and after three seconds the switch got toggled again to close the lock.
Just need something similar. Sadly the switch (KNX) is not sending a state back.
I tried it with an automation which caused on infinite event of closing and opening the door.
Without seeing your config it is hard to tell.
I take it that the door opener itself works fine in HA and the issue is just in lovelace.
I’d assume that something like this should work (untested):
type: entity-button
name: Open door
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.open_the_door
entity: script.open_the_door
script:
- alias: Open the door
service: switch.toggle
data:
entity_id: switch.the_door
Thanks a lot. I will test this later.
Here is my config:
type: entity-button
tap_action:
action: toggle
hold_action:
action: none
entity: switch.haustur
icon: 'mdi:door'
As I´m still new to HA where do I have to put the script?
Actually this should be enough:
type: entity-button
name: Open door
tap_action:
action: call-service
service: switch.toggle
service_data:
entity_id: switch.haustur
entity: switch.haustur
icon: 'mdi:door'
Hmm…this simply toggle the switch once and I need to set it back manually
Ok, if it is just that reset after the three seconds that is missing, I’d suggest to try the script path. https://www.home-assistant.io/components/script/
And use something like:
script:
- alias: Open the door
- service: switch.turn_on
data:
entity_id: switch.the_door
- delay:
seconds: 3
- service: switch.turn_off
data:
entity_id: switch.the_door
After a few months I had finally the time to check this. It works but the script needs to be different:
alias: Haustür
sequence:
- data:
entity_id: switch.door
service: switch.turn_on
- delay: 00:00:04
- data:
entity_id: switch.door
service: switch.turn_off
Thanks for your help!