Events and actions
Events
Events are fired on the Home Assistant event bus. Every event contains these fields:
| Field | Content |
|---|---|
entry_id | Config entry ID. |
device_id | Device registry ID. |
name | Name of the device. |
Additional fields per event:
| Event | Additional fields | When |
|---|---|---|
advanced_device_cycle_started | none | A cycle starts (transition to running). |
advanced_device_cycle_finished | duration_s, energy_kwh, cost | A cycle ends. cost is empty without a price sensor. Cycles shorter than the profile’s minimum duration are not counted. |
advanced_device_shutdown_blocked | reason: one_time_lock or external_off | A switch-off was blocked by the one-time lock, or an external off was reversed. |
advanced_device_shutdown_aborted | reason: switch_failed when the switch-off command failed; no reason field when the maximum wait was exceeded | A switch-off was cancelled. The plug stays on. |
Example automation trigger:
trigger:
- platform: event
event_type: advanced_device_cycle_finished
event_data:
entry_id: 01J0EXAMPLE
Actions
All actions take a device target. Select Advanced Device devices in the UI, or pass device_id as a list.
| Action | Fields | Effect |
|---|---|---|
advanced_device.force_off | device_id (required) | Switches the plug off now, ignoring the one-time lock. Same as the Force off button. |
advanced_device.lock_shutdown | device_id (required), duration (optional) | Blocks the next switch-off once. duration is a time period. If empty, the default expiry from the options is used. |
advanced_device.unlock_shutdown | device_id (required) | Removes the one-time lock. |
action: advanced_device.lock_shutdown
target:
device_id: 0123456789abcdef
data:
duration: "00:30:00"
Device triggers
Device triggers are available under the device’s Automations tab.
| Trigger type | Available | Fires on |
|---|---|---|
| Cycle started | with a power sensor or WashData device | advanced_device_cycle_started event |
| Cycle finished | with a power sensor or WashData device | advanced_device_cycle_finished event |
| Shutdown blocked | always | advanced_device_shutdown_blocked event |
| Status changed | always | Change of the status sensor. Optional field To status limits it to one state. |