28 lines
2.8 KiB
JSON
28 lines
2.8 KiB
JSON
[
|
|
{
|
|
"id": "Bluetooth Low Battery Notification",
|
|
"result": {
|
|
"structured": "TRIGGER: When the devices attribute of PC Bluetooth Connection [binary_sensor.pc_bluetooth_connection] changes state. CONDITIONS: The template condition evaluates to true, meaning the variable devices_below_threshold contains at least one device. ACTIONS: For each device in the devices_below_threshold list, run the Notify Me Script [script.notify_me] with a notification title 'Low Battery Alert' and a message stating the device's name and battery percentage.",
|
|
"natural_language": {
|
|
"trigger": "Whenever the list of connected devices reported by the PC Bluetooth Connection [binary_sensor.pc_bluetooth_connection] changes.",
|
|
"conditions": "The automation checks if the custom variable 'devices_below_threshold' contains any devices. This variable is computed by the automation's first action: it compares the new and old lists of devices from the trigger, and only includes devices whose battery level has just dropped below 40%.",
|
|
"action": "For each device identified as having a newly low battery, it sends a notification using the Notify Me Script [script.notify_me]. The notification will have a title 'Low Battery Alert' and a message specifying the device's name and its current battery percentage."
|
|
},
|
|
"human_like": "Sends a notification when a Bluetooth device's battery level falls below 40%.",
|
|
"complexity": "medium"
|
|
}
|
|
},
|
|
{
|
|
"id": "PC Bluetooth Monitor Webhook",
|
|
"result": {
|
|
"structured": "TRIGGER: When a webhook with ID 'bluetooth_monitor' is received via POST or PUT method, restricted to local network only. CONDITIONS: None. ACTIONS: Execute python_script.set_state to update PC Bluetooth Connection [binary_sensor.pc_bluetooth_connection] with state 'on' if trigger.json.bluetooth_connected is True, otherwise 'off'. Also set the entity's last_updated attribute to trigger.json.timestamp, device_count to the length of trigger.json.devices, and devices to trigger.json.devices.",
|
|
"natural_language": {
|
|
"trigger": "When a specific webhook request, identified by 'bluetooth_monitor', is sent to Home Assistant from the local network using either the POST or PUT method.",
|
|
"conditions": "There are no conditions that must be met.",
|
|
"action": "Updates the PC Bluetooth Connection [binary_sensor.pc_bluetooth_connection] sensor. It sets the sensor's state to 'on' if the webhook data indicates a Bluetooth connection is active, or 'off' if not. It also records the timestamp from the webhook, the number of connected devices, and the list of devices themselves as attributes of the sensor."
|
|
},
|
|
"human_like": "Updates a sensor to show whether a PC is connected to Bluetooth devices whenever a local webhook is received.",
|
|
"complexity": "low"
|
|
}
|
|
}
|
|
] |