Thermokon WRF04 CO2
Thermokon WRF04 is a sensor for CO2 concentration, the temperature and relative humidity (option) in room and office spaces. The integration with HSYCO is possibile via MODBUS protocol.
What to I need?
Hsyco, of course. A Modbus/gateway or a FTDI RS485 cable. For further information consult the Modbus IO server page.
First steps
Open the WRF04 sensor following the instruction of the data sheet. Configure the Modbus address, baud rate, parity using the dip switches. In this example we will use: 9600,8,1,0,0. Connect the WRF04 sensor to a Modbus bus. Assuming that we are using a Modbus/IP gateway this is a screenshot of the Modbus IO server definition in Settings:
Integration
Let's write this simple lines in events.txt file:
HSYCOSTART : PROGRAMTIMER modbusread = REPEAT 5 PROGRAMTIMER modbusread : IO modbus.1.256 = readinputregisters:short, IO modbus.1.257 = readinputregisters:ushort:2 IO modbus.1.256 : $temperature = IO modbus.1.256, $temperature / 10, log = "temperature: " $temperature " °C", UISET "wrf04.temperature.text" = $temperature " °C" IO modbus.1.257 : $humidity = IO modbus.1.257, $humidity / 10, log = "humididy: " $humidity " %", UISET "wrf04.humidity.text" = $humidity " %" IO modbus.1.258 : $co2 = IO modbus.1.258, log = "co2: " $co2 " ppm", UISET "wrf04.co2.text" = $co2 " ppm"