Hi Meinereiner, I have the exact same problem as you. I use the pm1006 sensor together with ESP32-WROOM with the following ESPhome code. So I got some debug information.
logger:
level: VERY_VERBOSE
uart:
rx_pin: ${pm1006_pin_tx}
tx_pin: ${pm1006_pin_rx}
baud_rate: 9600
debug:
direction: BOTH
dummy_receiver: false
after:
delimiter: "\n"
sequence:
- lambda: UARTDebug::log_string(direction, bytes);
sensor:
- platform: pm1006
pm_2_5:
id: pm2_5_value
name: "${node_name} PM2.5"
update_interval: 20s
According to the code on GitHub, the sensor should send the following request: 0x11, 0x02, 0x0B, 0x01, 0xE1
But it seems to send the character “v” instead of 0x0B.
See my log today.
[20:37:10][V][pm1006:024]: sending measurement request
[20:37:10][D][uart_debug:158]: >>> "\x11\x02\v\x01\xE1"
[20:37:10][V][pm1006:038]: Byte 0 of received data frame is invalid.
[20:37:10][V][pm1006:038]: Byte 0 of received data frame is invalid.
[20:37:10][V][pm1006:038]: Byte 0 of received data frame is invalid.
[20:37:10][V][pm1006:038]: Byte 0 of received data frame is invalid.
[20:37:10][V][pm1006:038]: Byte 0 of received data frame is invalid.
[20:37:10][V][component:199]: Component pm1006.sensor took a long time for an operation (0.05 s).
[20:37:10][V][component:200]: Components should block for at most 20-30ms.
[20:37:10][D][uart_debug:158]: <<< "\x11\x02\v\x01\xE1"
[20:37:10][VV][scheduler:185]: Running interval 'update' with interval=60000 last_execution=1102 (now=61105)
[20:37:10][V][sensor:074]: 'IKEA PM2.5 24h average': Received new state nan
[20:37:10][VV][sensor.filter:014]: Filter(0x3ffb2c44)::input(nan)
[20:37:10][VV][sensor.filter:183]: SlidingWindowMovingAverageFilter(0x3ffb2c44)::new_value(nan) -> 0.000000
[20:37:10][VV][sensor.filter:195]: SlidingWindowMovingAverageFilter(0x3ffb2c44)::new_value(nan) SENDING
[20:37:10][VV][sensor.filter:021]: Filter(0x3ffb2c44)::output(0.000000) -> SENSOR
[20:37:10][D][sensor:125]: 'IKEA PM2.5 24h average': Sending state 0.00000 µg/m³ with 1 decimals of accuracy
[20:37:10][V][text_sensor:016]: 'IKEA Air Quality Index': Received new state Bad
[20:37:10][D][text_sensor:067]: 'IKEA Air Quality Index': Sending state 'Bad'
[20:37:10][VV][api.service:174]: send_text_sensor_state_response: TextSensorStateResponse {
key: 252667721
state: 'Bad'
missing_state: NO
}
@Habbie, could you please confirm that I am proceeding correctly in finding the error?
Thank you so much.
I have also tried using an external component, but also without success.
external_components:
- source: github://pr#2214
components:
- pm1006