Add a Reset Total Energy button

This commit is contained in:
Aiden committed 2026-10-15 11:39:01 +08:00
1 parent 53807bdbae
commit cb2011f704
3 files changed
+33 -5

No files matched your search

+11 -1
View File
@@ -10,7 +10,7 @@ substitutions:
# Project Name
project_name: "China Athom Technology.Mini Relay V2"
# Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
project_version: "v3.1.3"
project_version: "v3.1.4"
# Restore the relay (GPO switch) upon reboot to state:
light_restore_mode: RESTORE_DEFAULT_OFF
# Set the update interval for sensors
@@ -328,6 +328,16 @@ button:
internal: false
entity_category: config
- platform: template
name: "Reset Total Energy"
icon: mdi:restart-alert
entity_category: config
on_press:
then:
- lambda: |-
id(total_energy) = 0.0;
id(total_energy_sensor).update();
output:
- platform: gpio
id: relay_output
+11 -3
View File
@@ -10,7 +10,7 @@ substitutions:
# Project Name
project_name: "China Athom Technology.Athom Plug V5"
# Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
project_version: "v5.0.5"
project_version: "v5.0.6"
# Restore the relay (GPO switch) upon reboot to state:
relay_restore_mode: RESTORE_DEFAULT_ON
# Set the update interval for sensors
@@ -285,8 +285,6 @@ sensor:
unit_of_measurement: kWh
filters:
- throttle: ${sensor_update_interval}
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
on_value:
then:
- lambda: |-
@@ -333,6 +331,16 @@ button:
internal: false
entity_category: config
- platform: template
name: "Reset Total Energy"
icon: mdi:restart-alert
entity_category: config
on_press:
then:
- lambda: |-
id(total_energy) = 0.0;
id(total_energy_sensor).update();
switch:
- platform: gpio
name: "Switch"
+11 -1
View File
@@ -10,7 +10,7 @@ substitutions:
# Project Name
project_name: "China Athom Technology.Athom Plug V3"
# Projection version denotes the release version of the yaml file, allowing checking of deployed vs latest version
project_version: "v2.0.8"
project_version: "v2.0.9"
# Restore the relay (GPO switch) upon reboot to state:
relay_restore_mode: RESTORE_DEFAULT_ON
# Set the update interval for sensors
@@ -377,6 +377,16 @@ button:
internal: false
entity_category: config
- platform: template
name: "Reset Total Energy"
icon: mdi:restart-alert
entity_category: config
on_press:
then:
- lambda: |-
id(total_energy) = 0.0;
id(total_energy_sensor).update();
switch:
- platform: gpio
name: "Switch"