Temperature control - How do I do this?

Hi,

I have a MySensors node that controls activities at my Pond (using MQTT). Whilst the norm is for OpenHAB (OH) to do the control, in this case I want the PondController (PdC) to do the work and decision making, but I want to configure it from OpenHAB (I guess you would call this centralised management, but decentralised control).

I have various ON/OFF values that I am already setting from OH and OH is also receiving the changes when I change them at the PdC. This works very well.
Additionally, I am receiving in OH the setting of the other numeric values. What I can’t figure out, is how to set the numeric values in OH and have these sent to my PdC.

The Configuration information are:

  • Temperatures (e.g. PondFreezeLimit, PondFreezeHysterisis)
  • Times (e.g. PumpOnTime, PumpOffTime)

Can anyone point me n the right direction?

Thank you

Hi Colin,

I think you want to have the openHAB MQTT binding publish messages to your MQTT broker, using items. For example, define an item:

Number PondFreezeLimit "PondFreezeLimit [%.1f °F]" { mqtt=">[broker:/topic:command:*:default]" }

When this Number item’s state is updated, it will publish the value to the broker on the topic. This can be done from a rule with

PondFreezeLimit.postUpdate(2)

and/or from the UI by defining a Setpoint widget in your sitemap, like:

Setpoint item=PondFreezeLimit min=-1 max=5 step=0.5

Hi,
Thank you so much for responding but I am still struggling a little or maybe a lot. I have to confess OpenHAB is new to me and so learning about items, sitemaps and rules. I apologise if I am missing the obvious.

I originally had the following binding in my items file. OH updates as I change configuration settings at my node and so I assume this is correct.
Number Pond_Freeze “Pump Frost Protection [%d °C]” (PondParams) { mqtt="<[broker:piMQTTout/11/6/1/0/0:state:default]" }

Where I get a little lost is with the Setpoint and rules suggestion. So the Setpoint first - I have added the following line to my sitemap file:
Setpoint item=PondFreezeLimit minValue=-1 maxValue=10 step=1
The control appears but the adjustment buttons appear to be disabled/greyed out. At least they do not respond to click attempts (actually neither do the adjustment buttons on the widgets demo frame).

Cracked it, I add the solution shortly for anyone else that is interested in this topic

OK, so my solution turned out to be very simple actually. Thanks to watou for putting me on the right track.

The first point is that I did not need to create a rule. All was handled within the sitemap and item definition. In my Sitemaps file, I added the following items:
Setpoint item=Pond_Freeze minValue=-1 maxValue=10 step=1
Setpoint item=Pond_Freeze_Hysterisis minValue=0 maxValue=5 step=1

And in the items file I added the following:
Number Pond_Freeze “Pump Frost Protection [%d °C]” (PondParams) { mqtt="<[broker:MQTTout:state:default], >[broker:MQTTin:command::default]" }
Number Pond_Freeze_Hysterisis “Pump Frost Hysterisis [%d °C]” (PondParams) { mqtt="<[broker:MQTTout:state:default], >[broker:MQTTin:command:
:default]" }

This works very well and is exactly what I wanted. :smile:

1 Like