MQTTSubscribe with topic payload that has data for several sensors #143
therocksweather
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
I am a suck it and see learner ........and have been following and trying to understand the MQTTSubscribe process for getting data into weewx. I have been mostly successful in getting this to work .........hopefully I can put this question/request together in a way you can understand.
So this is mainly about the AS3935 lightning sensor and using filters but the payload has other sensor data.
The topic/payload is put together by an esp32 running tasmota firmware
This is the mqtt topic{payload} to import to weewx
tele/esp32-sensors/SENSOR <<<< topic
{ <<<< start of payload
"Time":"2021-10-07T15:20:51", <<<< set as do not process in weewx
"BME280":{"Temperature":25.7,"Humidity":47.4,"DewPoint":13.6,"Pressure":1005.8},
"TSL2561":{"Illuminance":6223.000,"IR":87840,"Broadband":315312},
"AS3935":{"Event":0,"Distance":0,"Energy":0,"Stage":7},
"VEML6075":{"UvaIntensity":190,"UvbIntensity":147,"UvIndex":0.3},
"ESP32":{"Temperature":65.6},
"PressureUnit":"hPa", <<<< set as do not process in weewx
"TempUnit":"C" <<<< set as do not process in weewx
} <<<< end of payload
So the data that needs manipulation is "AS3935":{"Event":0,"Distance":0,"Energy":0,"Stage":7},
and in particular "Event":0,
where "Event" can be 0 to 9 which represents various detections and other information.
fyi Event is normally 0 ie listening ......no events
But I only want to import the data from Event 1 and Event 4.
So MQTTSubscribe has a useful filter
However I believe the filter out message drops the whole payload not just AS3935 part.
Data from all sensors dropped.
Would that be right????
AS3935 normally sends Event 0, I can import Event 0 which solves loss of "all" sensor data .........
I would only lose all data when Events = 2, 3, 5, 6, 7, 8, 9 appear.
but could the filter drop only the data from [[[[AS3935_???????]]]] and not the whole payload?
btw thanks for a great add on feature for weewx.
regards Ian
Beta Was this translation helpful? Give feedback.
All reactions