Open EdDickens opened 2 years ago
I'm seeing the same thing. using a D1 mini on ESPHOME 2022.12.13
Serial Data is incoming however it's not being processed correctly.. None of the datasamples are picked up.. The 1st four placements appear to be some sort of markup and board Gen/Rev since those never change. Only the later data is changing..
Sample of that debug output from the UART. I was able to find the data pattern and aligned them here.
01:03:0E:01:93:00:00:00:02:00:00:00:00:08:BD:0C:EC:A4:EF 01:03:0E:01:93:00:00:00:02:00:00:00:00:08:BB:0C:E6:C4:E9 01:03:0E:01:90:00:00:00:00:00:00:00:00:08:C0:0C:E5:E8:52 01:03:0E:01:90:00:00:00:00:00:00:00:00:08:BE:0C:E8:49:8F 01:03:0E:01:91:00:00:00:01:00:00:00:00:08:BB:0C:E6:D7:5B 01:03:0E:01:94:00:00:00:03:00:00:00:00:08:BD:0C:E6:22:3F 01:03:0E:01:93:00:00:00:02:00:00:00:00:08:BE:0C:E9:94:EC 01:03:0E:01:94:00:00:00:03:00:00:00:00:08:BD:0C:E8:A3:FB 01:03:0E:01:93:00:00:00:02:00:00:00:00:08:BB:0C:E6:C4:E9 01:03:0E:01:90:00:00:00:00:00:00:00:00:08:BD:0C:E1:79:89 01:03:0E:01:91:00:00:00:01:00:00:00:00:08:BB:0C:E5:97:5A 01:03:0E:01:91:00:00:00:01:00:00:00:00:08:BD:0C:E2:36:99 01:03:0E:01:90:00:00:00:00:00:00:00:00:08:BD:0C:E4:B9:8A 01:03:0E:01:91:00:00:00:01:00:00:00:00:08:BD:0C:E5:77:5B
These are two brand new sensors , It looks like they have started using 19 vs the old 17 placements. and thus throwing off the reading and processing of the feed. -Thanks
same issue.
I think I may have stumbled on the new sequence.
Byte name Description
B1 Slave address Address value
B2 function code 03h
B3 Return the number of bytes 0x0E
B4 data eCO2 High byte
B5 data eCO2 Low byte
B6 data eCH2O High byte
B7 data eCH2O Low byte
B8 data TVOC High byte
B9 data TVOC Low byte
B10 data PM2.5 High byte
B11 data PM2.5 Low byte
B12 data PM10 High byte
B13 data PM10 Low byte
B14 data Temperature "High" byte
B15 data Temperature "Low" byte
B16 data Humidity "High" byte
B17 data Humidity "Low" byte
B18 CRC 16 low
B19 CRC16 high
Working to validate these since my readings seem a little high.
I've got the values worked out. Should see a new component here soon called sm300d2v2 since this is a v2 hardware variant. Submitting for contribute.
Hey Duker! I see that you closed your PR, did anything change?
I've got it working. however i'm stalled on getting it approved for commit. The ESPhome owner wanted to see if I could somehow merge the two devices instead of creating a 2nd hardware type. Unfortunately, My skills aren't quite that high. I've made a few attempts, But due to how the Serial is parsed. I haven't been able to make it universal and merge with the original code. The New hardware code is under a device called sm300d2v2
https://github.com/Duker4444/esphome Here's the link to the codebase. It's still in there. Feel free to take a look.
The problem
I have a new SM300D2 sensor connected to an ESP01. I’ve got the ESP flashed with a basic config to get things running. All the Entities show up in HA with no problems. The problem is actually reading from the sensor. Seem to be having the same issues reported here. From that thread it seems the issue was fixed at one point but I cannot get anything from the sensor.
Which version of ESPHome has the issue?
2022.10.0
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2022.10.5
What platform are you using?
ESP8266
Board
ESP-01
Component causing the issue
SM300D2
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
A bit more info after some troubleshooting.
Using a USB to Serial adapter, I'm able to read the messages from the sensor.
What I’m seeing is 17 bytes most of the time with 18 showing up on occasion. When there’s 18 bytes the last byte is always 0x00.
First two bytes are 0x7F and 0x7E.
Using the test data values from the SM300D2 Documentation, I get the correct calculated values for all parameters.
Switch to live data and I probably wouldn’t be able to type this if these values were true.