Closed pehedima closed 4 years ago
Hi @pehedima,
I added parameters "divider" and "multiplier", specially for this, you can update your gateway to the version from master branch and check it.
To use it, you need just put "divider": 10
into you config like:
{
"server": {
"name": "temerature serial",
"type": "serial",
"port": "/dev/ttyUSB0",
"baudrate": 9600,
"timeout": 35,
"method": "rtu",
"devices": [
{
"unitId": 1,
"deviceName": "TEMP-Home-python-balena-serial",
"attributesPollPeriod": 3600000,
"timeseriesPollPeriod": 5000,
"sendDataOnlyOnChange": false,
"timeseries":[
{
"tag":"Temperatur_Buero",
"type":"long",
"functionCode":3,
"address":0,
"registerCount":1,
"byteOrder":"BIG",
"divider": 10
}
]
}
]
}
}
Thanks you for your fast reply and the implementation of the two new parameters :) It's working.
Only the 'multiplier'-function should be changed from:
decoded_data = decoded_data/configuration["multiplier"]
to:
decoded_data = decoded_data*configuration["multiplier"]
Then everthing should work correctly.
Oh, yep thanks.
Oh, yep thanks.
Hi @pehedima,
I added parameters "divider" and "multiplier", specially for this, you can update your gateway to the version from master branch and check it.
To use it, you need just put
"divider": 10
into you config like:{ "server": { "name": "temerature serial", "type": "serial", "port": "/dev/ttyUSB0", "baudrate": 9600, "timeout": 35, "method": "rtu", "devices": [ { "unitId": 1, "deviceName": "TEMP-Home-python-balena-serial", "attributesPollPeriod": 3600000, "timeseriesPollPeriod": 5000, "sendDataOnlyOnChange": false, "timeseries":[ { "tag":"Temperatur_Buero", "type":"long", "functionCode":3, "address":0, "registerCount":1, "byteOrder":"BIG", "divider": 10 } ] } ] } }
Hello, I know "devicer" and "multiplier" can config in *json file,but can you add "offset" too? for example ,Calibrate the temperature. source value is 10, offset = -2,end value is 8.
I use a normal temperature sensor (MODBUS RTU) to send the temperature to thingsboard server. The read value from the device is the temperature multiplied by 10. That means, that the value of the register is for example 194 -> 19.4 degrees Celsius. This value should be send to thingsboard server.
What is the easiest way to calculate that before sending?
Here the tb_gateway.yaml and the JSON script to communicate with the device.
modbus-serial-temperature-config.zip tb_gateway.zip
Thanks in advance.