Hi,
I have looked at the documentation on templates and I think this is a tempate application but one that is too complex for my current level of understanding. The end objective is to monitor the wattage of an energy monitoring plug and turn it off if the wattage averages a certain amount (300) for 2 minutes. I need to use average because the normal fluctuation is 20-40 watts (it is powering a water pump).
I am probably overthinking this but it seems I would need to look at the wattage reports every 30 seconds and use a certain number of those observations to get the average. The other idea I had was to have a counter that gets incremented every time the wattage goes below 300 and turn the switch off if the count goes above a certain amount.
Following the second approach, I got to this point but not sure how to check the counter value and get it to turn off if it’s 10. I added a Choose but get an error when saving (“Message malformed: Must contain at least one of below, above”):
alias: Pump Wattage Monitor
description: ""
trigger:
- type: power
platform: device
device_id: 7094747e36478d716dd717c94952e5e6
entity_id: c5dd3f4e74819b0f6b7d03f250bbdb20
domain: sensor
below: 300
condition: []
action:
- service: counter.increment
metadata: {}
data: {}
target:
entity_id: counter.low_wattage_counter
- choose:
- conditions:
- condition: numeric_state
entity_id: counter.low_wattage_counter
value_template: "10"
sequence:
- type: turn_off
device_id: 7094747e36478d716dd717c94952e5e6
entity_id: 8777f42ad86162c5c3a24e0d4ddc1386
domain: switch
mode: single
Any other suggestions are welcome.