[kwlug-disc] Modern way of doing Lex/Yacc
Khalid Baheyeldin
kb at 2bits.com
Thu Jun 23 11:57:24 EDT 2022
On Wed, Jun 22, 2022 at 10:26 PM William Park via kwlug-disc <
kwlug-disc at kwlug.org> wrote:
> How do you express these in JSON format? Maybe
> "cooling": {
> "temperature_set_to" : 25,
> "exec" : "air_conditioner.exe"
> },
> "heating": {
> "temperature_set_to" : 15,
> "exec" : "furnace.exe"
> }
>
William,
I am wondering what these sensors are? They may already have a format for
the
message payload, and there can be ways to reformat or translate that
output.
For example, I have an Acu-rite weather station, which has its own display.
The
outdoor sensor gets the temperature, humidity, wind speed, rain amount,
...etc.
and sends it to the display which has limited statistics (e.g. max and min,
rain
in the past 2 days, ...etc.)
But the sensor uses the widely used 433 MHz band, and there are RTL-SDR
dongles
that can read this info together with an open source program called
rtl_433, which
decodes many IoT sensors, even car tire pressure sensors.
The rtl_433 program can output in many formats, including CSV, JSON,
...etc. It also
can send the payload to MQTT.
So I was able to capture the output using a wrapper Python program, then
feed it into
Home Assistant (and from there to InfluxDB and graph it in Grafana), as
well as Weewx
(an open source personal weather station software written in Python).
Here is how the Grafana panel looks like:
https://imgur.com/HNJExxq.png
Sorry for the long digression on a tangential topic.
But the morale of the story is this: solutions may already exist for what
you have, and
not only just one piece, but several.
Don't write new code/configuration unless you made sure there is nothing
out there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20220623/80aa3a1d/attachment.htm>
More information about the kwlug-disc
mailing list