From 9f8289042b364a28b5e1cc88e9802300b19397d2 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Fri, 8 Nov 2024 02:23:48 -0300 Subject: [PATCH] Add Minimum Voltage protection --- athom-smart-plug-v2.yaml | 6 ++++++ athom-smart-plug.yaml | 6 ++++++ athom-wall-outlet.yaml | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/athom-smart-plug-v2.yaml b/athom-smart-plug-v2.yaml index a14bdeaf..398f70df 100644 --- a/athom-smart-plug-v2.yaml +++ b/athom-smart-plug-v2.yaml @@ -10,6 +10,8 @@ substitutions: relay_restore_mode: RESTORE_DEFAULT_ON # Current Limit in Amps. AU Plug = 10. IL, BR, EU, UK, US Plug = 16. current_limit : "16" + # Minimum Voltage before turning off the switch output. + minimum_voltage: "90" # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: "" # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney") @@ -201,6 +203,10 @@ sensor: name: "Voltage" filters: - throttle_average: ${sensor_update_interval} + on_value_range: + - below: ${minimum_voltage} + then: + - switch.turn_off: relay power: name: "Power" diff --git a/athom-smart-plug.yaml b/athom-smart-plug.yaml index 99011647..d1726e87 100644 --- a/athom-smart-plug.yaml +++ b/athom-smart-plug.yaml @@ -11,6 +11,8 @@ substitutions: sensor_update_interval: 10s # Current Limit in Amps. AU Plug = 10. IL, BR, EU, UK, US Plug = 16. current_limit : "10" + # Minimum Voltage before turning off the switch output. + minimum_voltage: "90" # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: "" # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney") @@ -216,6 +218,10 @@ sensor: accuracy_decimals: 1 filters: - skip_initial: 2 + on_value_range: + - below: ${minimum_voltage} + then: + - switch.turn_off: relay power: name: "Power" diff --git a/athom-wall-outlet.yaml b/athom-wall-outlet.yaml index 16d4e132..7c53f43f 100644 --- a/athom-wall-outlet.yaml +++ b/athom-wall-outlet.yaml @@ -10,6 +10,8 @@ substitutions: relay_restore_mode: RESTORE_DEFAULT_OFF # Current Limit in Amps. AU Plug = 10. IL, BR, EU, UK, US Plug = 16. current_limit : "16" + # Minimum Voltage before turning off the switch output. + minimum_voltage: "90" # Define a domain for this device to use. i.e. iot.home.lan (so device will appear as athom-smart-plug-v2.iot.home.lan in DNS/DHCP logs) dns_domain: "" # Set timezone of the smart plug. Useful if the plug is in a location different to the HA server. Can be entered in unix Country/Area format (i.e. "Australia/Sydney") @@ -191,6 +193,10 @@ sensor: name: "Voltage" filters: - throttle_average: ${sensor_update_interval} + on_value_range: + - below: ${minimum_voltage} + then: + - switch.turn_off: relay power: name: "Power"