Difference between revisions of "Thermokon WRF04 CO2"
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | Thermokon WRF04 is a sensor for CO2 concentration, | + | Thermokon WRF04 is a sensor for detection of CO2 concentration, temperature and relative humidity in room and office spaces. The integration with HSYCO is possibile via MODBUS protocol. |
== What to I need? == | == What to I need? == | ||
Line 6: | Line 6: | ||
== First steps == | == 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. | + | 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 and Modbus address 1. |
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: | 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: | ||
− | [[File:Integrations WRF04.png| | + | |
+ | [[File:Integrations WRF04.png|center|500px]] | ||
+ | |||
+ | == Integration == | ||
+ | |||
+ | Let's write this simple lines in events.txt file: | ||
+ | |||
+ | INIT : 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" | ||
+ | |||
+ | Basically this is a polling request to the device. Every five seconds HSYCO is reading the value contained in the registers 256,257,258 which, accordingly to the WRF04 Modbus table, are respectively: temperature, humidity, co2 ppm. |
Latest revision as of 15:24, 26 March 2014
Thermokon WRF04 is a sensor for detection of CO2 concentration, temperature and relative humidity 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 and Modbus address 1. 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:
INIT : 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"
Basically this is a polling request to the device. Every five seconds HSYCO is reading the value contained in the registers 256,257,258 which, accordingly to the WRF04 Modbus table, are respectively: temperature, humidity, co2 ppm.