I have a Sonoff S31power monitor outlet with an HA sensor (sensor.garage_refrigerator_amps) which anything over an amp is a good indication it is running. This is my input select:
input_select:
refrigerator_status:
name: Garage Refrigerator Status
options:
- Idle
- Running
These are my automations.
automation 28:
alias: Set refrigerator running
trigger:
- platform: numeric_state
entity_id: sensor.garage_refrigerator_amps
above: 1.1
condition:
condition: or
conditions:
- condition: state
entity_id: input_select.refrigerator_status
state: idle
- condition: state
entity_id: input_select.refrigerator_status
state: running
action:
- service: input_select.select_option
data:
entity_id: input_select.refrigerator_status
option: Running
automation 29:
alias: Set refrigerator idle
trigger:
- platform: numeric_state
entity_id: sensor.garage_refrigerator_amps
below: 1.1
condition:
condition: and
conditions:
- condition: state
entity_id: input_select.refrigerator_status
state: running
action:
- service: input_select.select_option
data:
entity_id: input_select.refrigerator_status
option: Idle
I can manually trigger the automations and it changes the state from Idle to Running and vice versa. However it will not do it automatically as it should. Stumped.
Your input select wasnāt working because you were conditioning off of it equal to running and idle, not Running and Idle. Home assistant is case sensitive.
Thanks guys. All that stuff worked. I appreciate the super fast and accurate help!
My next parlor trick will be to set up an automation which will let me know if the door is left open. When the light comes on in the fridge it draws exactly 0.41 amps. Iāll set it up to where if it is between say 0.3 and 0.6 amps for more than 1 or 2 minutes then it will send me a text. That was kind of the whole learning process leading up to this
I just got it figured out. At first I went for 0.3 to 0.6 amps and that was all wonderful until I figured out that if you leave the door open the compressor kicks on and the amp draw goes way out of that range and Open or Closed means nothing (with that configuration).
Then I noticed my fridge pulls around 160 to 180 watts max, running and opening the door and the (probably 40 watt lamp) makes it jump to 220 or so.
To be safe I set the sensor to watts and set a range of 190 to 250 watts for 45 seconds and has it send me a text after that. Just tested it like 10 times and it works great. Worst case scenario it takes about 5 or 6 minutes at the most before you get the text. That is if the refrigerator is cold and it takes a few minutes to kick on and I have the Tasmota flashed Sonoff S31 set to a TelePeriod of 60 seconds
automation 30:
alias: Refrigerator Door Open
trigger:
- platform: numeric_state
entity_id: sensor.garage_refrigerator_watts
above: 190
below: 250
for:
seconds: 45
condition:
condition: or
conditions:
- condition: state
entity_id: input_select.refrigerator_door_open
state: Open
- condition: state
entity_id: input_select.refrigerator_door_open
state: Closed
action:
- service: input_select.select_option
data:
entity_id: input_select.refrigerator_door_open
option: Open
- service: notify.clicksend
data_template:
title: "Garage Refrigerator Door Open"
message: >-
The Garage Refrigerator Door Is Open
automation 31:
alias: Set refrigerator door closed
trigger:
- platform: numeric_state
entity_id: sensor.garage_refrigerator_watts
below: 190
condition:
condition: and
conditions:
- condition: state
entity_id: input_select.refrigerator_door_open
state: Open
action:
- service: input_select.select_option
data:
entity_id: input_select.refrigerator_door_open
option: Closed