Domoticz HTTP Poller Lua json ......

Moderator: leecollings

Post Reply
User avatar
klaus44
Posts: 8
Joined: Wednesday 20 November 2019 11:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Aktuell
Location: Berlin/Germany
Contact:

Domoticz HTTP Poller Lua json ......

Post by klaus44 »

Hello dear user community


Sorry for my English, Google Translator helped :)

I don't know if I'm right here, but I'll try to explain. I don't get any further due to a lack of skills and little documentation.


I have a Rasbeery pi3 running in the garden with rtl_433 USB STICK and also 2 x 433 mhz temperature sensors, I have the output of the temperature data saved in json via rtl433 on the raspbeery in the garden.

At home I also have a Raspbeery pi 3 with Domoticz to run. with DSL

I update the Json file from the garden with Weewx Update on a third-party server via LTE hotspot.

I want to integrate the Json file into Domoticz ..!


I can read the Json file from the foreign ftp server with the HTTP poller, no problem. ....

I don't know how I can evaluate the json data via HTTP poller and Lua so that domoticz understands the json file.

It's not a static json ....

I've tried a lot of options, but I can't find the right solution.

I also know weewx-sdr, so I have a problem with that and can't get any further.


Maybe someone can help me with this problem via Lua or other options or ideas.





Maybe there is another possibility.

Many Thanks






My saved json file from rtl_433 looks like this.













{"time" : "2021-01-11 10:08:04", "model" : "Conrad-S3318P", "id" : 233, "channel" : 1, "battery_ok" : 1, "temperature_C" : 18.500, "humidity" : 45, "button" : 0, "mic" : "CRC"}
{"time" : "2021-01-11 10:09:04", "model" : "Conrad-S3318P", "id" : 233, "channel" : 1, "battery_ok" : 1, "temperature_C" : 18.500, "humidity" : 45, "button" : 0, "mic" : "CRC"}
{"time" : "2021-01-11 10:10:45", "model" : "inFactory-TH", "id" : 162, "channel" : 2, "battery_ok" : 1, "temperature_C" : 20.444, "humidity" : 39, "mic" : "CRC"}
{"time" : "2021-01-11 10:11:45", "model" : "inFactory-TH", "id" : 162, "channel" : 2, "battery_ok" : 1, "temperature_C" : 20.444, "humidity" : 39, "mic" : "CRC"}
{"time" : "2021-01-11 10:12:04", "model" : "Conrad-S3318P", "id" : 233, "channel" : 1, "battery_ok" : 1, "temperature_C" : 18.500, "humidity" : 45, "button" : 0, "mic" : "CRC"}
{"time" : "2021-01-11 10:13:04", "model" : "Conrad-S3318P", "id" : 233, "channel" : 1, "battery_ok" : 1, "temperature_C" : 18.500, "humidity" : 45, "button" : 0, "mic" : "CRC"}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Domoticz HTTP Poller Lua json ......

Post by waaren »

klaus44 wrote: Tuesday 12 January 2021 13:43 Maybe someone can help me with this problem via Lua or other options or ideas.
You might want to look at the examples at the dzVents wiki page how to to process JSON from http calls.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
klaus44
Posts: 8
Joined: Wednesday 20 November 2019 11:33
Target OS: Raspberry Pi / ODroid
Domoticz version: Aktuell
Location: Berlin/Germany
Contact:

Re: Domoticz HTTP Poller Lua json ......

Post by klaus44 »

Thanks for the information

yes, I know the site, it doesn't help me any further, because I have no knowledge of programming .... or there is no example for my json data stream ...
User avatar
bewo
Posts: 74
Joined: Monday 13 July 2015 12:27
Target OS: Linux
Domoticz version: 2021.1
Location: Bavaria - Germany
Contact:

Re: Domoticz HTTP Poller Lua json ......

Post by bewo »

Hi Klaus,

please help me, if i correctly understood your problem:
The raspberry in your garden sends his output via an LTE hotspot to an server. And you would like to read this file from the server?
OK -> No problem. ;)

What should be the rythm? Once a minute? All five minutes? Every hour?

What do you mean with "It's not a static json ....". The scheme of the example you've posted is static.
In your example there are more than one entry for each device. Which one should be used? The first? The newest? An average?

Please serve this informations. And i can help you.
Best regards to Berlin :D
Individual projects:
Domoticz on a Intel Xeon Server | AeonLabs Z-Wave Gen.5 | RFXCOM RFXtrx433E USB | ESP-Wifi-Modules | Shellys
Wall-mounted 22" Touch Control Display (self construct) | LUA wind monitor| LUA heating control | and many many more :)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest