py-air-control icon indicating copy to clipboard operation
py-air-control copied to clipboard

JSON output

Open wldevries opened this issue 3 years ago • 2 comments

It would be great if this tool could dump the status as a JSON object. This would make integration with other systems much easier. For this to work well with multiple appliances ideally the ID or IP address of the device would be included as well.

My goal is to send the output of airctrl to MQTT, possibly to hook up logic, but my first main goal is to graph the PM2.5 and allergen index values over time in Grafana.

wldevries avatar Mar 14 '21 12:03 wldevries

@wldevries if you call airctrl with -d (d for debug) you get json + "normal data"

  • the json-data has a problem -> False/True should be false/true (see my comment in #54)
  • I agree, it would be nice to get json-only, I'm trying to get something similar for my homeautomation (which can read json natively)
  • I'll make a new PR for this after my PR #81

Cyber1000 avatar Mar 31 '21 02:03 Cyber1000

Maybe a refactoring (#34) would be the best, the "library" part (for example CoAPAirClient) already returns json, just the command-line part prettifies/formats the output.

Cyber1000 avatar Mar 31 '21 02:03 Cyber1000