I have noticed something weird. If the device boots up and the CO2 is high the LED will not get switched on. But if I boot it up in a room with low CO2 the LED will get turned on and work fine. Looking at the logs after deployment shows this as well, since the moment it goes below 800 LED colour gets changed. Any idea what could be causing this?
[07:06:18][C][api:139]: API Server:
[07:06:18][C][api:140]: Address: co2-office.local:6053
[07:06:19][C][api:142]: Using noise encryption: YES
[07:06:51][D][sensor:094]: 'Office CO2': Sending state 1675.00000 ppm with 0 decimals of accuracy
[07:06:51][D][sensor:094]: 'Office Temperature': Sending state 21.67976 °C with 2 decimals of accuracy
[07:06:51][D][sensor:094]: 'Office Humidity': Sending state 57.09076 % with 2 decimals of accuracy
[07:06:53][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:06:53][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:07:51][D][sensor:094]: 'Office CO2': Sending state 1672.00000 ppm with 0 decimals of accuracy
[07:07:51][D][sensor:094]: 'Office Temperature': Sending state 19.03084 °C with 2 decimals of accuracy
[07:07:51][D][sensor:094]: 'Office Humidity': Sending state 66.39557 % with 2 decimals of accuracy
[07:07:53][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:07:53][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:08:51][D][sensor:094]: 'Office CO2': Sending state 1739.00000 ppm with 0 decimals of accuracy
[07:08:51][D][sensor:094]: 'Office Temperature': Sending state 18.07220 °C with 2 decimals of accuracy
[07:08:51][D][sensor:094]: 'Office Humidity': Sending state 71.22040 % with 2 decimals of accuracy
[07:08:53][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:08:53][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:09:51][D][sensor:094]: 'Office CO2': Sending state 1752.00000 ppm with 0 decimals of accuracy
[07:09:51][D][sensor:094]: 'Office Temperature': Sending state 17.82387 °C with 2 decimals of accuracy
[07:09:51][D][sensor:094]: 'Office Humidity': Sending state 72.18170 % with 2 decimals of accuracy
[07:09:53][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:09:53][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:10:51][D][sensor:094]: 'Office CO2': Sending state 1239.00000 ppm with 0 decimals of accuracy
[07:10:51][D][sensor:094]: 'Office Temperature': Sending state 17.59422 °C with 2 decimals of accuracy
[07:10:51][D][sensor:094]: 'Office Humidity': Sending state 64.23035 % with 2 decimals of accuracy
[07:10:53][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:10:53][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:11:10][I][ota:117]: Boot seems successful, resetting boot loop counter.
[07:11:10][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:11:10][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[07:11:51][D][sensor:094]: 'Office CO2': Sending state 688.00000 ppm with 0 decimals of accuracy
[07:11:51][D][light:036]: 'CO2 Status LED' Setting:
[07:11:51][D][light:047]: State: ON
[07:11:51][D][light:051]: Brightness: 20%
[07:11:51][D][light:059]: Red: 0%, Green: 100%, Blue: 0%
[07:11:51][D][sensor:094]: 'Office Temperature': Sending state 17.10823 °C with 2 decimals of accuracy
[07:11:51][D][sensor:094]: 'Office Humidity': Sending state 58.26263 % with 2 decimals of accuracy
[07:11:51][W][component:214]: Component scd4x.sensor took a long time for an operation (0.05 s).
[07:11:51][W][component:215]: Components should block for at most 20-30ms.
[07:11:53][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:11:53][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
Booting up in low CO2:
[07:13:53][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
WARNING co2-office @ 192.168.11.244: Connection error occurred: [Errno 104] Connection reset by peer
INFO Processing unexpected disconnect from ESPHome API for co2-office @ 192.168.11.244
WARNING Disconnected from API
INFO Successfully connected to co2-office @ 192.168.11.244 in 0.011s
INFO Successful handshake with co2-office @ 192.168.11.244 in 0.126s
[07:15:07][D][sensor:094]: 'Office CO2': Sending state 632.00000 ppm with 0 decimals of accuracy
[07:15:07][D][light:036]: 'CO2 Status LED' Setting:
[07:15:07][D][light:047]: State: ON
[07:15:07][D][light:051]: Brightness: 20%
[07:15:07][D][light:059]: Red: 0%, Green: 100%, Blue: 0%
[07:15:07][D][sensor:094]: 'Office Temperature': Sending state 19.81056 °C with 2 decimals of accuracy
Booting up in high CO2:
WARNING co2-office @ 192.168.11.244: Connection error occurred: [Errno 104] Connection reset by peer
INFO Processing unexpected disconnect from ESPHome API for co2-office @ 192.168.11.244
WARNING Disconnected from API
INFO Successfully connected to co2-office @ 192.168.11.244 in 0.007s
INFO Successful handshake with co2-office @ 192.168.11.244 in 0.109s
[07:22:33][D][api:102]: Accepted 192.168.20.21
[07:22:33][D][api.connection:1121]: Home Assistant 2024.3.0 (192.168.20.21): Connected successfully
[07:22:46][D][sensor:094]: 'Office CO2': Sending state 1866.00000 ppm with 0 decimals of accuracy
[07:22:46][D][sensor:094]: 'Office Temperature': Sending state 21.42075 °C with 2 decimals of accuracy
[07:22:46][D][sensor:094]: 'Office Humidity': Sending state 56.79474 % with 2 decimals of accuracy
[07:22:56][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:22:56][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:23:46][D][sensor:094]: 'Office CO2': Sending state 1770.00000 ppm with 0 decimals of accuracy
[07:23:46][D][sensor:094]: 'Office Temperature': Sending state 18.33122 °C with 2 decimals of accuracy
[07:23:46][D][sensor:094]: 'Office Humidity': Sending state 68.45093 % with 2 decimals of accuracy
[07:23:56][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:23:56][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:24:46][D][sensor:094]: 'Office CO2': Sending state 1735.00000 ppm with 0 decimals of accuracy
[07:24:46][D][sensor:094]: 'Office Temperature': Sending state 17.35924 °C with 2 decimals of accuracy
[07:24:46][D][sensor:094]: 'Office Humidity': Sending state 73.24219 % with 2 decimals of accuracy
[07:24:56][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:24:56][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:25:46][D][sensor:094]: 'Office CO2': Sending state 1743.00000 ppm with 0 decimals of accuracy
[07:25:46][D][sensor:094]: 'Office Temperature': Sending state 17.06818 °C with 2 decimals of accuracy
[07:25:46][D][sensor:094]: 'Office Humidity': Sending state 75.24872 % with 2 decimals of accuracy
[07:25:56][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:25:56][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:26:46][D][sensor:094]: 'Office CO2': Sending state 1749.00000 ppm with 0 decimals of accuracy
[07:26:46][D][sensor:094]: 'Office Temperature': Sending state 17.01210 °C with 2 decimals of accuracy
[07:26:46][D][sensor:094]: 'Office Humidity': Sending state 75.52795 % with 2 decimals of accuracy
[07:26:56][D][esp32.preferences:114]: Saving 1 preferences to flash...
[07:26:56][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[07:27:16][I][ota:117]: Boot seems successful, resetting boot loop counter.