Take a look at these links: https://github.com/weewx/weewx/wiki/mqtt https://obrienlabs.net/how-to-setup-your-own-mqtt-broker/ https://github.com/bellrichm/WeeWX-MQTTSubscribe/wiki
On Wednesday, September 15, 2021 at 4:30:35 PM UTC-4 [email protected] wrote: > Vince and everyone, > I have a RAK7244 LoRa (chirpstack) setup on my LAN that is getting data > from two LHT65 temp/hum sensors. All seems to be working correctly. > My goal is to import the data into weewx which I have running on an rpi. > Not being a programmer, I seem to be WAY OVER my head with how to set up > mqtt and deal with json files. I have tried the python program kindly > offered by Ralph Underwood and it seems to be subscribing to the json data: > > MQTT_SERVER = "192.168.1.10" > MQTT_TOPIC = "application/#" *** [using '#' to get everything] > > Connected with result code 0 > application/7/device/a8404117b18312e9/rx > {"applicationID":"7","applicationName":"LHT65","deviceName":"LHT65x","devEUI":"a8404117b18312e9","txInfo":{"frequency":905100000,"dr":0},"adr":true,"fCnt":1376,"fPort":2,"data":"y+wJUAHgAQlHf/8=","object":{"BatV":3.052,"Ext_sensor":"Temperature > > Sensor LHT65","Hum_SHT":"48.0","TempF_DS":"74.75","TempF_SHT":"74.91"}} > {"applicationID":"7","applicationName":"LHT65","deviceName":"LHT65x","devEUI":"a8404117b18312e9","txInfo":{"frequency":905100000,"dr":0},"adr":true,"fCnt":1376,"fPort":2,"data":"y+wJUAHgAQlHf/8=","object":{"BatV":3.052,"Ext_sensor":"Temperature > > Sensor LHT65","Hum_SHT":"48.0","TempF_DS":"74.75","TempF_SHT":"74.91"}} > > application/7/device/a84041468182b4da/rx > {"applicationID":"7","applicationName":"LHT65","deviceName":"LHT65-1","devEUI":"a84041468182b4da","txInfo":{"frequency":904300000,"dr":0},"adr":true,"fCnt":1367,"fPort":2,"data":"y9ELFQGRAQr2f/8=","object":{"BatV":3.025,"Ext_sensor":"Temperature > > Sensor LHT65","Hum_SHT":"40.1","TempF_DS":"82.51","TempF_SHT":"83.07"}} > {"applicationID":"7","applicationName":"LHT65","deviceName":"LHT65-1","devEUI":"a84041468182b4da","txInfo":{"frequency":904300000,"dr":0},"adr":true,"fCnt":1367,"fPort":2,"data":"y9ELFQGRAQr2f/8=","object":{"BatV":3.025,"Ext_sensor":"Temperature > > Sensor LHT65","Hum_SHT":"40.1","TempF_DS":"82.51","TempF_SHT":"83.07"}} > > At this point I'm not sure what to do to get the data into weewx. If > anyone can offer a suggestion I would be most grateful. > Thanks. > Bob > > On Saturday, April 6, 2019 at 10:04:28 AM UTC-4 vince wrote: > >> On Saturday, April 6, 2019 at 6:52:06 AM UTC-7, Ralph Underwood wrote: >>> >>> I have a small python program that subscribes to mqtt and writes a text >>> file. I then use the filepile as a service to get the data into WeeWx. The >>> "main" data comes from a Ultimeter station via the driver. >>> >>> >>> >> I have a similar setup that reads pi sensors and writes a JSON file that >> nginx serves up on a secondary pi. I wrote a weewx service that grabs that >> file and populates a custom weewx db, although the code is somewhat ugly >> under the hood to say the least. >> >> A better example is the weatherflow UDP driver. That does a web get of a >> JSON formatted file, maps the elements to a database schema of your >> choosing, and populates the database. Very very stable. It would be a >> great example for how to grab a web endpoint and populate a custom db. >> >> >> -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/ccfd9751-4e5a-4e67-b44d-e17b024c3140n%40googlegroups.com.
