Solved: Need help with nodered, please

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
phloks
Posts: 7
Joined: Friday 21 July 2017 9:59
Target OS: Linux
Domoticz version: 3.8185
Location: NL
Contact:

Solved: Need help with nodered, please

Post by phloks »

Hi,

I just need a kick in the right direction....
Although my question does not pertain to the functionality of Domoticz itself, I still would like to ask the question here, because I feel that it is closely related...
What I'm trying to achieve is this:
I have a WH3080 weather staion, and its data is received wirelessly using rtl_433. The JSON data is then fed into a MQTT server, and the MQTT client (which is installed on the Domoticz server) can subscribe to the messages without problem.
So, I now have JSON messages coming from my WH3080 available for processing on the Domoticz server.

These messages look like this:

Code: Select all

{"time" : "2018-03-06 11:45:56", "model" : "Fine Offset Electronics WH1080/WH3080 Weather Station", "msg_type" : 0, "id" : 55, "temperature_C" : 12.500, "humidity" : 48, "dire
ction_str" : "W", "direction_deg" : "270", "speed" : 2.448, "gust" : 4.896, "rain" : 443.700, "battery" : "OK"}                                                                
Or:

Code: Select all

"time" : "2018-03-06 11:47:28", "model" : "Fine Offset Electronics WH3080 Weather Station", "msg_type" : 2, "uv_sensor_id" : 100, "uv_status" : "OK", "uv_index" : 3, "lux" : 
27101.000, "wm" : 39.679, "fc" : 2518.680}                                                                                                                                     
And now for the part where I'm stuck.....

I understand that I need to convert the original JSON messages into JSON messages Domoticz understands, and from what I have read sofar, Node-Red is the tool to do this.
However, I'm struggling to find documentation on how to do this.

Questions:
1) Do I need to use Node-Red ?
I think I could also write a script that parses the received JSON messages into a (series of) JSON messages ready to be used in Domoticz, and publish this output in another topic in MQTT, and read this in Domoticz.

2) If Node-Red is the way to go, can someone please point me in the right direction how to achieve my goal ?

Thanks for the help !
Hans

Edit
Found a post somewhere else that explains my question a bit more.
FYI: https://groups.google.com/forum/#!topic ... Qjt5uUobPo
GCB2016
Posts: 33
Joined: Thursday 10 November 2016 22:13
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.9208
Location: Rotterdam
Contact:

Re: Solved: Need help with nodered, please

Post by GCB2016 »

HI Hans, I am in the same situation. Did you find a way to convert it so that Domoticz understands it via node-red? Thanks!
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Solved: Need help with nodered, please

Post by Dnpwwo »

@phloks,

If you have the message in MQTT you can also create a Python plugin to handle the messages within Domoticz itself.

Have a look at https://github.com/emontnemery/domoticz ... /plugin.py for a Python MQTT client, also there is a example that ships with Domoticz plugins/examples/MQTT Subscribe.py
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest