various tidyups
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#:########################################################################################:##
|
||||
# Main House Power Peak #
|
||||
#:########################################################################################:##
|
||||
# Tracks the calendar-day maximum of the main three-phase active-power sensor for the
|
||||
# Flounder dashboard. The helper retains its value across restarts and resets at midnight.
|
||||
|
||||
input_number:
|
||||
main_house_power_peak_today:
|
||||
name: Main House Power Peak Today
|
||||
icon: mdi:flash-triangle-outline
|
||||
min: 0
|
||||
max: 50000
|
||||
step: 1
|
||||
mode: box
|
||||
unit_of_measurement: W
|
||||
|
||||
automation:
|
||||
- id: main_house_power_peak_today_track
|
||||
alias: Main House Power Peak Today - Track
|
||||
mode: single
|
||||
triggers:
|
||||
- trigger: state
|
||||
entity_id: sensor.main_house_3_phase_power_monitor_main_power_total_active_power
|
||||
- trigger: homeassistant
|
||||
event: start
|
||||
conditions:
|
||||
- condition: template
|
||||
value_template: >-
|
||||
{{ states('sensor.main_house_3_phase_power_monitor_main_power_total_active_power') not in ['unknown', 'unavailable'] }}
|
||||
- condition: template
|
||||
value_template: >-
|
||||
{{
|
||||
states('sensor.main_house_3_phase_power_monitor_main_power_total_active_power') | float(0)
|
||||
> states('input_number.main_house_power_peak_today') | float(0)
|
||||
}}
|
||||
actions:
|
||||
- action: input_number.set_value
|
||||
target:
|
||||
entity_id: input_number.main_house_power_peak_today
|
||||
data:
|
||||
value: "{{ states('sensor.main_house_3_phase_power_monitor_main_power_total_active_power') | float(0) }}"
|
||||
|
||||
- id: main_house_power_peak_today_reset
|
||||
alias: Main House Power Peak Today - Reset
|
||||
mode: single
|
||||
triggers:
|
||||
- trigger: time
|
||||
at: "00:00:00"
|
||||
actions:
|
||||
- action: input_number.set_value
|
||||
target:
|
||||
entity_id: input_number.main_house_power_peak_today
|
||||
data:
|
||||
value: 0
|
||||
Reference in New Issue
Block a user