hi can anyone offer some help with an automation or switch i am trying to make work please
so i have an entity switch.sonoff_1000#####
this is my heating control switch ( on/off)
i have a temperature guage on my hotwater tank
that gives me numeric readings entity sensor.hwater
so i am trying to create a manual switch that turns on the heating , notifys me its on , after checking the temperature is below 50 from my sensor.hwater
it will then keep the heating on until it reaches 50, then notify me " the water is now hot " and then it should turn the sonoff back to off
it will need to read the state of the switch.sonoff as well , so if its already on , dont turn it on
so i only want the switch to be able to manually turn on , if sensor.hwater is below 50
and for it to turn itself off , when it reaches 50 or above .
not sure how i add that condition
thankyou in advance ( i did try adding some conditon lines and running that in the template tool , but cant get it to work )
Can you format your code properly please?
It appears you are confusing a switch configuration for a script or an automation. A switch is neither of those things.
ok , i didnt know that.
i did try making this as an autmation , but im just not very good at it yet.
but i liked the ability to switch it from within lovelace, is that possible with an autmation ?
can you understand what i am trying to achieve, or have i made that to vague as well
Hi Robin, i got it working , but it does not turn the water heater off at 50.00 celcius,
i am not sure how i would test a script , without running it. the turn on script starts the heater , i can see that
but when temperature had reached over 52 it still hadnt run the script to turn the heater off, and stop the script running.
there doesnât seem to be a reason to make it so complicated.
basically you need two automations - one to turn the heater switch on only if the temp is below 50. the other will turn the heater switch off at above 50 (plus a bit to allow for hysteresis).
then you want to add in a manual âswitchâ to start the process rolling. So use an input_boolean for that.
the only thing you havenât clarified is what happens if the temp is above 50 and then you turn the input boolean on? I assume that when you turn on the boolean you want to wait until the temp is below 50 then turn the heater switch on. then when the temp goes above (say) 52 you thyen want the swiutch to turn off and not be able to turn back on until you tell it to turn back on by using the boolean? At least thatâs how I would do itâŚI think)
So if thatâs case:
input_boolean:
heater_control_boolean:
name: Master Heater Control
automation:
- alias: turn on the heater below 50
trigger:
platform: numeric_state
entity_id: sensor.your_temp_sensor
below: 50
condition:
condition: state
entity_id: input_boolean.heater_control_boolean
state: 'on'
action:
service: switch.turn_on
entity_id: switch.sonoff_1000#####
- alias: turn off the heater above 52
trigger:
platform: numeric_state
entity_id: sensor.your_temp_sensor
above: 52
condition:
condition: state
entity_id: switch.sonoff_1000#####
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.sonoff_1000#####
- service: input_boolean.turn_off
entity_id: input_boolean.heater_control_boolean
then just put the input boolean on a card in the lovelace configuration so you cvan see it and be able to easily turn it off and on and see its state
Thankyou Finity.
i will give this a go, and let you know .
to answer your questions ,
yes a manual switch on my front end, that will turn on my heater , if temp is below 50
if temperature is above 50 , it will not turn on , maybe tell me water is already hot .
and yes when temperature is equal to 50, turn the heater off and message me " waters hot "
Thankyou for you time and coding , i really apreciate it .
will try it and let you know how that runs for me .
ok it all works it was me thanks Robin that works really well thankyou so much.
is there a way at the front end of showing when a script is running , and how would i trigger the script
from the front end, i wanted a button i pushed and the cript would run, and tell me its running ?
Iâm interested in your setup as Iâm trying to achieve similar control on my HWT.
I got a Sonoff TH16 with 4 x temperature probes attached to my tank monitoring the water temperature and Iâm noticing some interesting values. For example the water temperature at the top of the tank drops slower compare to bottom which cools quickly once the water is being used at tap/shower.
Curious where your gauges gets the temperature from.
There are a few ways you can make it visable from the Lovelace UI. I think I would make and binary_sensor template to check if the script is running and show this in lovelace (binary_sensors change colors in the interface where scripts do not).
You can make any item of a glance-card call your service so maybe you can give the binary_sensor an tap_action so it can also activate it. that code can look something like this:
Hi Yulasinio
My Temp probe is in the middle of my hot water tank,
as you said the top is hotter that the bottom, theres two reasons, hot water rises and the feed to your hot water tank is at the bottom so as you use the hot water , from the top of the tank cold water enters to fill the void at the bottom.
hope this helps
Thanks. Thatâs why I was asking where your temp probe is placed, because if it was at the bottom where the thermostat is fitted your boiler will be ON constantly