Hello,
I just received my DIY Pro (pre-soldered) with the SGP41 TVOC module and everything is working fine.
I wanted to use it with Home Assistant / ESPHome and used this configuration file:
To add the TVOX and NOx data, I added the code from this site:
No problem on the Home Assistant side, I can see all the data.
But on Airgradient site, I can see that some data are missing:
- TVOC (Ind40)
- NOx (Ind41)
- PM Reduction
For TVOC, however the TVOC (Ind30) data is correctly populated.
What should I do to upload the missing data to Airgradient site ?
Here is what I currently have in my ESPHome config file:
interval:
- interval: 10s
then:
- display.page.show_next: oled
- component.update: oled
- interval: 5min
# Send data to AirGradient API server
# for more details have a look at sendToServer() function:
# https://www.airgradient.com/open-airgradient/blog/airgradient-diy-pro-instructions/
then:
- http_request.post:
# AirGradient URL with the last 3 bytes of the MAC address in Hex format all lower case
url: !lambda |-
return "http://hw.airgradient.com/sensors/airgradient:" + get_mac_address().substr(6,11) + "/measures";
headers:
Content-Type: application/json
# "!lambda return to_string(id(pm2).state);" Converts sensor output from double to string
json:
wifi: id(airgradient_wifi_signal).state
pm01: !lambda return to_string(id(pm_1_0).state);
pm02: !lambda return to_string(id(pm_2_5).state);
pm10: !lambda return to_string(id(pm_10_0).state);
pm003_count: !lambda return to_string(id(pm_0_3um).state);
rco2: !lambda return to_string(id(co2).state);
atmp: !lambda return to_string(id(temp).state);
rhum: !lambda return to_string(id(humidity).state);
tvoc: !lambda return to_string(id(tvoc).state);
nox: !lambda return to_string(id(nox).state);
verify_ssl: false