41 lines
3.2 KiB
JSON
41 lines
3.2 KiB
JSON
[
|
|
{
|
|
"id": "8f59d1bc-33a5-467b-9909-487d1a534452",
|
|
"result": {
|
|
"structured": "TRIGGER: When Home Assistant is shutting down (event: shutdown). CONDITIONS: None. ACTIONS: For each media player entity that has a defined volume_level attribute, save the current volume level to a variable named <entity_id>.volume_level.",
|
|
"natural_language": {
|
|
"trigger": "When the Home Assistant system begins its shutdown process.",
|
|
"conditions": "There are no conditions that must be met.",
|
|
"action": "For every media player that has a volume level attribute, the automation backs up its current volume setting by saving it to a uniquely named variable for that entity."
|
|
},
|
|
"human_like": "Backs up the volume levels of all media players when Home Assistant is shutting down, so they can be restored later.",
|
|
"complexity": "medium"
|
|
}
|
|
},
|
|
{
|
|
"id": "21318363-635e-4850-bc4b-1389c76f8df8",
|
|
"result": {
|
|
"structured": "TRIGGER: When Home Assistant starts. CONDITIONS: None. ACTIONS: For each media player entity that does NOT have a defined volume_level attribute, if the entity's volume backup variable exists in saver.saver [saver.saver], restore that entity's volume level to the saved value (rounded to 2 decimal places, defaulting to 0.6 if not found).",
|
|
"natural_language": {
|
|
"trigger": "When the Home Assistant system starts up.",
|
|
"conditions": "There are no specific conditions that must be met for the action to run.",
|
|
"action": "The automation goes through every media player that does not currently have a volume level set. For each such player, it checks if a previously saved volume level exists for it in the media player backup volume variable saver [saver.saver]. If a saved value is found, it restores the player's volume to that level. If not, it sets the volume to a default level of 0.6."
|
|
},
|
|
"human_like": "Restores the volume levels for all media players to their previously saved settings when Home Assistant restarts.",
|
|
"complexity": "medium"
|
|
}
|
|
},
|
|
{
|
|
"id": "f6845dff-4f8c-462c-b439-8db9ea67dc10",
|
|
"result": {
|
|
"structured": "TRIGGER: When any entity's state changes (state_changed event). CONDITIONS: The changed entity's entity_id starts with 'media_player.' AND the new state's attributes contain 'volume_level'. ACTIONS: Set a variable named '<entity_id>.volume_level' to the value of the new state's 'volume_level' attribute, rounded to 2 decimal places (defaulting to 0.6 if missing or invalid).",
|
|
"natural_language": {
|
|
"trigger": "Whenever the state of any entity in the system changes.",
|
|
"conditions": "The entity whose state changed must be a media player, identified by its entity_id starting with 'media_player.', and the new state of that entity must have a 'volume_level' attribute.",
|
|
"action": "Saves the new volume level of that specific media player to a variable, rounding the value to two decimal places. If the volume level is missing or not a valid number, it defaults to 0.6."
|
|
},
|
|
"human_like": "Backs up the volume level of any media player whenever it changes, storing it for later use.",
|
|
"complexity": "medium"
|
|
}
|
|
}
|
|
] |