Nettigo Air Monitor (based on Luftdaten)

Hi
I`m new in hubitat community and happy user of new C8.
I bought Nettigo Air Monitor to monitor outdoor air quality (especially PM values) ? it is well supported in HA but I want to monitor it directly via Hubitat to add some rules connected to home ventilation

this is the nettigo project

I assume that interesting will be

  • /data.json - measured values in JSON format (this is snapshot of last data set sent to APIs not current values as shown on /values page)

example of my data.json is
{"software_version": "NAMF-2020-45", "age":"92", "measurements":"7277", "uptime":"1200743", "sensordatavalues":[{"value_type":"SDS_P1","value":"5.10"},{"value_type":"SDS_P2","value":"3.40"},{"value_type":"HECA_temperature","value":"12.36"},{"value_type":"HECA_humidity","value":"76.36"},{"value_type":"HECA_Tdc","value":"0.00"},{"value_type":"HECA_RHdc","value":"100.00"},{"value_type":"HECA_dc","value":"100.00"},{"value_type":"BME280_temperature","value":"11.81"},{"value_type":"BME280_pressure","value":"96600.17"},{"value_type":"BME280_humidity","value":"82.57"},{"value_type":"samples","value":"110288"},{"value_type":"min_micro","value":"1270"},{"value_type":"max_micro","value":"22083"},{"value_type":"signal","value":"-64"}]}

SDS_P2 is PM2.5
SDS_P1 is PM10

How to integrate it as a sensor in Hubitat ? please help me with writing the driver

anyone have a clue how to parse that json in a driver ? on create automation for reading just the pm25 value

If the response comes back as application/json you can do a httpGet with textparser:false and the response.data will be returned as a HashMap. Then just a matter of stepping through the map, i.e.

response.data.sensordatavalues.each {
   if(it.value_type == ‘SDS_P2’) 
       sendEvent(name:’pm25’, value:”${it.value}”)
}

If it doesn’t you can use a jsonSlurper to do the initial conversion, and then process similarly.