Hi guys,
after a full day of tinkering, I’v got OH2 up and running on a RPI.
Now I need a simple control for a water heater like temp <50C Power on / >70C Power Off.
A Temp setting in the Webui would be great also.
What I have so far:
A “Sonoff TH16” connected via MQTT, which displays the proper Temp. in OH2
A “switch” in OH2 which also works, so I can turn on/off the Sonoff TH16
home.items:
Number SonoffTemp "Aktuelle Temperatur [%.1f °C]" <temperature> {mqtt="<[broker:tele/sonoff-TH16/SENSOR:state:JSONPATH($.DS18B20.Temperature)]"}
Switch Schalter "Ein/Aus" <light> (LR,gLight){ mqtt=">[broker:cmnd/sonoff-TH16/POWER:command:*:default],<[broker:stat/sonoff-TH16/POWER:state:default]" }
home.sitemap
sitemap home label=“TEST”
{
Frame label=“TH16”
{
Text item=SonoffTemp
Switch item=Schalter icon=“light”
}
}
So I think, I need some kind of rule, which triggers/reads the temp and switches the Sonoff on/off?
I tried some code snippets from here and there, but none of them worked as expected.
Any help (understandable for a non-coder) please…
Show us what you have tried
Write a rule from the snippets, it probably won’t work but we’ll help you make it work as show you why it was not working
We won’t write a rule for you but we’ll help make your work. It’s the best way to learn
If we just give you a rule that you then copy and paste, the next time you need another rule to do something else you’ll be just as stuck.
So have a go, you can’t really break anything
Seems, I was just to impatient, because my Sonoff sends MQTT states only every 5 minutes, so I just had to wait…
I guess @Harry is also correct, since his rule is almost identical.
Thanks so far:
Now to the next step…any ideas how to realize the Temperature settings via Webgui?
BTW: I’ve used this rule:
rule “Water too cold”
when
Item SonoffTemp changed
then
if (SonoffTemp.state < 30) {
Schalter.sendCommand(ON)
}
if (SonoffTemp.state > 33) {
Schalter.sendCommand(OFF)
}
end
That works great!
Thank you very much.
Tomorrow I will try to implement a “min/max temperature” solution.
I think, with this working examples now, it shouldn’t be a major issue…otherwise
As I said in post #7
Remember to use as Number to get the state of an item number to a Number Type
(WunschTemp.state as Number)
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
13
Hi
I’ve just set something like this up for a client.
I used a slider in their UI for the target temperature and another slider to set the Hystisis (they opted for a +/- of 4°c in the real world and a target of 50°c, the image below is from my development setup)