Using the current version of OpenHAB (2.5.4) and Node RED, I’m trying to set a rule whereby a device is commanded ON when a temperature drops below a set temperature and is commanded OFF when temperature hits a higher limit, acting as a basic domestic thermostat.
I’m using the DS18B20 Temperature Sensor and onewire binding on a Raspberry Pi 3, using GPIO pin:4.
The Items file looks like:
Number:Temperature Testbench_Temperature_Sensor1 “Temperature (Sensor 1) [%.1f]” { channel=“onewiregpio:sensor:Measured_Temperature_Sensor1:temperature” }
The Thing file looks like:
Thing onewiregpio:sensor:Measured_Temperature_Sensor1 “Testbench Temperature 1” [gpio_bus_file=“/sys/bus/w1/devices/28-031760490dff/w1_slave”,refresh_time=30,precision=1]
When using the “openhab in” node, I am unable to extract a value from the generated strings (from either the Top Channel or Bottom Channel), in order execute the if statements required for the thermostatic control.
Example output from Top Channel:
21.8 ?C
Example output from Bottom Channel:
{“topic”:“smarthome/items/Testbench_Temperature_Sensor1/state”,“payload”:{“type”:“Quantity”,“value”:“21.8 °C”},“type”:“ItemStateEvent”}
Please help me find a simple solution to this issue?
I’ve searched online, on lots of forums, for finding a solution, but no where else is data generated when the value is so embedded within a string.
Many Thanks
Dan