I am making a thermostat with Home Assistant to drive a water cooler. I have a relay that kicks on when the temperature is above a threshold and then kicks off when it is below that threshold.
This works fine in testing with me grabbing the temperature sensor with my hand. The relay kicks on after I grab it and turns off after it cools down again.
What I can’t figure out is how to incorporate a water sensor. I have a sensor that measures a voltage based on the water level and that is working on it’s own. I multiply that voltage by 1000 to make the settings easier. Basically the thermostat should turn off and remain off if the water level drops below 48V (sensor reading).
I have tried adding conditions in various places, but I’m not figuring this out.
Oh I didn’t find that, that looks quite useful! Thanks for pointing that out.
That looks to handle a standard HVAC system. I think I have the same question of how to prevent the system from kicking on if there is no water in the reservoir.
This article looks to be on the right track, but it’s using a binary switch and not a water level.
Ok, I got it working. Appreciate the nudge in the right direction. I am now using a Generic Thermostat, and an automation to turn it off or on if water is present or not.
Here is the automation to look at the water level
- id: '1701751066071'
alias: Water Cooler Thermostat control
trigger:
- platform: state
entity_id:
- binary_sensor.water_level
action:
- service: "climate.turn_{{ trigger.to_state.state }}"
target:
entity_id: climate.water_cooler
mode: single
- id: '1701751066071'
alias: Water Cooler Thermostat control
trigger:
- platform: numeric_ state
entity_id: sensor.water_level
above: 48
for: 60 # seconds. If your sensor is noisy
id: 'on'
- platform: numeric_ state
entity_id: sensor.water_level
below: 48
for: 60 # seconds. If your sensor is noisy
id: 'off'
action:
- service: "climate.turn_{{ trigger.id }}" # dont forget to quote your single line templates!
target:
entity_id: climate.water_cooler
mode: single