The DEV blueprint is designed to monitor the total power consumption and automatically turn off specified switches when the consumption exceeds a predefined threshold. It includes options for custom actions and notifications.
You can import this blueprint here:
In my case, i used a custom template that sum all of my *_power data. Here's how you can do that:
- With VSCode Server extension or File Editor, open the configuration.yaml file (the one inside the /config folder) and paste this code:
- platform: template sensors: total_power: friendly_name: "Total Power" entity_id: - sensor.sensorname1_power - sensor.sensorname2_power value_template: "{{ (states('sensor.sensorname1_power')|float + states('sensor.sensorname2_power')|float)|round(3) }}" unit_of_measurement: "W"
-
Total Power (W)
- Description: Select the sensor that represents the sum of all the switches' consumption in watts.
-
Maximum Threshold in W
- Description: Enter the threshold in watts. If the total power consumption exceeds this threshold, the cascade shutdown of switches will be triggered.
-
Check Delay (seconds)
- Description: Enter the delay in seconds that must pass after the first switch turns off. If, after this delay, the consumption is still above the threshold, the shutdown sequence repeats with the next switch.
-
Devices to Notify (Push)
- Description: A list of devices with the HomeAssistant app installed to be notified when the threshold is exceeded.
-
List of Switches to Turn Off
- Description: Insert the switches in order of priority. The first switch in the list will be the first to be turned off when the threshold is exceeded.
-
Custom Actions
- Description: Specify any additional custom actions to perform when the threshold is reached (e.g., notifications, TTS announcements).
-
Threshold Variable
- Description: Represents the threshold value set by the user.
-
Total Power Variable
- Description: Represents the total power sensor selected by the user.
-
Switches Variable
- Description: Represents the list of switches selected by the user.
-
Delay Variable
- Description: Represents the delay value set by the user.
- Platform: Numeric state
- Entity ID: Total power sensor
- Above: Threshold value
-
Notification Sequence
- Description: Sends notifications to the specified devices when the threshold is exceeded.
-
Custom Actions
- Description: Performs any additional custom actions specified by the user.
-
Switch Shutdown Sequence
- Description: Iterates through the list of switches, turning them off with a delay specified by the user.
-
Notification Sequence (End)
- Description: Sends notifications to the specified devices when all switches have been turned off.
-
Configuration:
- Set the total power sensor, threshold, check delay, devices to notify, switches, and any custom actions.
-
Trigger:
- When the total power exceeds the defined threshold, the automation is triggered.
-
Actions:
- Notifications are sent to specified devices.
- Custom actions are executed.
- Switches are turned off sequentially with a delay.
- Notifications are sent to specified devices when all switches have been turned off.
-
End Result:
- The automation responds to high power consumption by notifying users, executing custom actions, and turning off switches in a cascading fashion.