So I’ve had this automation set up exactly like this for a few months and used it several days a week without issue.
What the automation does:
Turns my jacuzzi on for 60 mins without paying attention to the thermostat temp at any point (hence the “boil” in the name).
Frontend button that calls a service - automation: trigger
That automation has two trigger events, each with its own trigger ID.
Event Trigger #1 is the triggering of the same automation (so self-referential?), event trigger #2 is the finishing of a timer.
Automation then has to choose actions based on which trigger ID was triggered.
Lovelace button card code below:
show_name: true
show_icon: true
type: button
name: Jacuzzi 60m Boil
show_state: true
icon: mdi:timer
hold_action:
action: none
tap_action:
action: call-service
service: automation.trigger
target:
entity_id: automation.jacuzzi_60m_boil
data:
skip_condition: true
This button then triggers the automation below:
alias: Jacuzzi 60m Boil
description: ""
trigger:
- platform: event
event_type: automation_triggered
event_data:
entity_id: automation.jacuzzi_60m_boil
id: jacuzz_on
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.60_min_timer
id: jacuzz_off
action:
- choose:
- conditions:
- condition: trigger
id:
- jacuzz_on
sequence:
- service: notify.mobile_app_sm_f926b
data:
message: Jacuzzi boil on
- service: timer.start
data: {}
target:
entity_id: timer.60_min_timer
- service: switch.turn_on
data: {}
target:
entity_id: switch.sonoff_1001770eb0
- conditions:
- condition: trigger
id:
- jacuzz_off
sequence:
- service: switch.turn_off
data: {}
target:
entity_id: switch.sonoff_1001770eb0
Recently this just stopped working and I cannot figure out why.
When I tap the button on lovelace it shows on the automation edit screen that the first trigger is triggered, but it stops there. When I change the trigger_id for the “on” sequence to the “off” trigger all those actions are executed without issue.
When looking at my traces I get the following message regarding the automation_triggered event:
That doesn’t make any sense either.
I’m lost please help!
EDIT:
I’ve tried changing mode from single to restart. Restart just makes the TRIGGERED notification in the automation edit screen flash like a strobe for a while.
EDIT SOLVED(ISH):
After trying to find a different way to trigger the automation while keeping my two trigger IDs in the automation so that I can use the choose function instead of using two separate automations, I ended up using a button helper on Lovelace.
The trigger became:
platform: state
entity_id:
- input_button.jacuzzi_60min_boil
id: jacuzz_on
On lovelace the entity for the button card is the helper entity that I made, which just involved giving it a name, and the tap action is set to toggle. state shows the last time it was tapped.