I have a Z-wave temperature-humidity sensor (Heiman).
The sensor works fine and in Node-Red I can query the device every minute, but the values change only after 5 min.
I know the Heiman sends out values at shorter intervals.
How can I capture the Temp/Hum values in 'real time' and send them to MQTT ?
The values of the Temperature and Humidity 'devices' in Blockly seem to be updated faster, but I cannot get the values out via a script.
The only method I have found is using a long chain of 'if' commands and a script to send out a MQTT message, but there must be a more efficient way to do this.
Getting values from temperature-humidity sensor
Moderator: leecollings
-
- Posts: 23
- Joined: Friday 12 January 2018 11:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Contact:
- FireWizard
- Posts: 1905
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Getting values from temperature-humidity sensor
Hello @GammaKappa,
How do you query the Heimann Z-Wave sensor in Node Red?
They have: node-red-contrib-zwave-js (https://flows.nodered.org/node/node-red ... b-zwave-js), but also node-red-contrib-zwavejs2mqtt (https://flows.nodered.org/node/node-red ... avejs2mqtt), and also nodes for openzwave.
If you have them in MQTT it is easy to send the values to Domoticz.
Regards
How do you query the Heimann Z-Wave sensor in Node Red?
They have: node-red-contrib-zwave-js (https://flows.nodered.org/node/node-red ... b-zwave-js), but also node-red-contrib-zwavejs2mqtt (https://flows.nodered.org/node/node-red ... avejs2mqtt), and also nodes for openzwave.
If you have them in MQTT it is easy to send the values to Domoticz.
Regards
-
- Posts: 23
- Joined: Friday 12 January 2018 11:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Contact:
Re: Getting values from temperature-humidity sensor
After inclusion in Z-wave the Heiman created device #1282 in Domoticz and it appears under the 'Temperature' tab.
I use the following flow :
The 'inject' node triggers every minute
The 'exec' node request the values of #1282 using
The 'json' node nicely formats the output so it can be used further on.
My problem is that this seems to query the log file which updates only every 5 min. So I miss the intermediate values.
I use the following flow :
The 'inject' node triggers every minute
The 'exec' node request the values of #1282 using
Code: Select all
curl -s 'http://192.168.1.xxx:8080/json.htm?type=devices&rid=1282'
My problem is that this seems to query the log file which updates only every 5 min. So I miss the intermediate values.
- FireWizard
- Posts: 1905
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Getting values from temperature-humidity sensor
Hi, @GammaKappa,
Okay I understand.
I do not know the internal details of Domoticz that much, that I can confirm that if you query a specific sensor fromDomoticz, that the value is taken from the Domoticz log.
As you have Node Red installed, I assume you have also installed Mosquitto.
Why not use MQTT, instead of html? This will send a message every update of the value.
It is just a MQTT input node, and a switch node as a filter on msg.payload.idx, so that only messages with IDX 1282 may pass.
Regards.
Okay I understand.
I do not know the internal details of Domoticz that much, that I can confirm that if you query a specific sensor fromDomoticz, that the value is taken from the Domoticz log.
As you have Node Red installed, I assume you have also installed Mosquitto.
Why not use MQTT, instead of html? This will send a message every update of the value.
It is just a MQTT input node, and a switch node as a filter on msg.payload.idx, so that only messages with IDX 1282 may pass.
Regards.
-
- Posts: 23
- Joined: Friday 12 January 2018 11:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Contact:
Re: Getting values from temperature-humidity sensor
Can I publish the value of just one device to MQTT ? I don't want to flood my MQTT broker with all updates of all devices.
- FireWizard
- Posts: 1905
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Getting values from temperature-humidity sensor
Hi @GammaKappa,
You asked:
No, you cannot, but in my opinion, you should not be worried about that.
I do not think that you will publish more than 1000 messages/second, which can easily be handled by a Raspberry Pi,
You can publish the MQTT messages under the topic domoticz/out/$idx without retain.
This will save you a switch node, if you subscribe to domoticz/out/$idx, as you don't need to filter.
Try it, and see if you get the result.
Regards
You asked:
Can I publish the value of just one device to MQTT?
No, you cannot, but in my opinion, you should not be worried about that.
I do not think that you will publish more than 1000 messages/second, which can easily be handled by a Raspberry Pi,
You can publish the MQTT messages under the topic domoticz/out/$idx without retain.
This will save you a switch node, if you subscribe to domoticz/out/$idx, as you don't need to filter.
Try it, and see if you get the result.
Regards
Last edited by FireWizard on Sunday 12 September 2021 23:11, edited 1 time in total.
-
- Posts: 23
- Joined: Friday 12 January 2018 11:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Contact:
Re: Getting values from temperature-humidity sensor
@FireWizard
Publishing via MQTT does indeed give me the 'real time' values of the sensor.
Thanks !
Publishing via MQTT does indeed give me the 'real time' values of the sensor.
Thanks !
- FireWizard
- Posts: 1905
- Joined: Tuesday 25 December 2018 12:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Voorthuizen (NL)
- Contact:
Re: Getting values from temperature-humidity sensor
Hi @GammaKappa,
In this case, if you leave it this way, mark the issue as solved.
Regards
In this case, if you leave it this way, mark the issue as solved.
Regards
-
- Posts: 23
- Joined: Friday 12 January 2018 11:57
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Contact:
[Solved]: Getting values from temperature-humidity sensor
Indeed solved.
Thanks again FireWizard.
Thanks again FireWizard.
Who is online
Users browsing this forum: No registered users and 1 guest