My I-9PSL is having issues starting in home assistant with the error Failed setup, will retry: Field "led_bar_mode" of type LedBarMode in Config has invalid value None. There are many other users reporting the same issue in AirGradient integration not able to start · Issue #168434 · home-assistant/core · GitHub
I briefly looked into this but wasn’t able to track down the root cause. It seems like AirGradient devices can return duplicate ledBarMode fields from /config; the first value is valid, but the later duplicate is null, which causes python-airgradient to parse the final value as None and fail.
curl http://192.168.3.57/config
Simplified response from my device:
{
"configurationControl": "local",
"temperatureUnit": "f",
"ledBarMode": "co2",
"model": "I-9PSL",
"extendedPmMeasures": false,
"ledBarMode": null
}
Note the duplicate ledBarMode key above. I believe Home Assistant ends up seeing ledBarMode: null instead of ledBarMode: "co2".
