Did you know that co2.click Model E and E-Lite have a local API that you can use to get the instantaneous state and measurement from the sensor ?
This API can be activated on your sensor by going to the Configuration menu, tapping on the "Data handling options" and checking the "Local API" checkbox.
Following this, when your sensor is connected to your Wi-Fi network, you can query its state. Here is an example using curl:
curl -s -H "Accept: application/json" -H "Authorization: Bearer MY_SENSOR_UUID_ALL_CAPS" http://MY_SENSOR_DNS.local:8080/state
MY_SENSOR_UUID_ALL_CAPS is your sensor UUID where all letters are capitalized.
MY_SENSOR_DNS is available in the Info screen of your sensor and will look lite co2click-AABBCC where AABBCC are the last 3 bytes of your sensor UUID.
The API will return a JSON object that will look like this on Model E-Lite:
{
"uuid": "MY_SENSOR_UUID_ALL_CAPS",
"co2": 680,
"humidity": 58,
"temperature": 20,
"pm01": 0,
"pm03": 0,
"pm05": 0,
"pm10": 2.219000101,
"pm25": 2.328000069,
"pm50": 0,
"pm100": 2.328000069,
"pressure": 1020.398614,
"voc": 98,
"firmwareVersion": "1.5.1",
"model": "E-Lite",
"pcbVersion": 0,
"isCharging": true,
"isACIN": true,
"battVoltage": 3.913000107,
"battPct": 71.26999664
}
You can use this to perform automation of more advanced functions.
Hope you enjoy our sensors, and make sure to subscribe to our mailing list to receive more news like this.