-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
pm1006: add rx-only support #2038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
oxan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds ESPHome support for the IKEA VINDRIKTNING.
Ikea keeps coming up with more and more unpronouncable names 😆
I was going to say that as a European I can mostly cope - but you and I live in the same country :D Thank you for your comments - I believe I have addressed them all (except possibly CI complaining about formatting, but we'll see). |
and now I actually pushed this. |
oxan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check_byte_() has a somewhat peculiar convention for the return value, but it's fine I guess.
I was just answering a question about that from somebody else. I agree it's peculiar - as I said earlier, I stole most of the code from sds011. I'm now tempted to redo some things -less- in the style of sds011, as I suspect that will improve the code quality. |
I've pondered this some more, and I think it makes sense to me to merge this as-is (assuming a maintainer agrees), and then later I can go over this one, and SDS011, and any others with the same weird code patterns, in one go. |
|
Keep up the good work @Habbie!! Just bought one of these s*ckers today at IKEA and mounted it to my ESP8266. Would very much like to get this working. If I can help out testing, please mention me :) |
Hi Abeltje, testing would be very welcome, of course. Functionally, this PR is done. Perhaps the question is what I can do to help you test? I'm on the ESPHome Discord at https://discord.gg/KhAMKrd |
The question is really, when is this PR going to be merged?! ;) |
|
I've tested this driver/component with an IKEA Vindriktning air quality monitor and ESP8266, works like a charm, thanks! 🎉 Fetched just the pm1006 component from the PR branch with external_components. |
|
Same here. Works like a charm! 👌🏻 |
|
As inspiration for others considering this driver for the awesome IKEA Vindriktning hack. I used an old ESP8266 NodeMCU v2 from the drawer and connected it all up as listed below.
Example YAML (ESPHome >= 2021.8.0 required): uart:
rx_pin: D2
baud_rate: 9600
sensor:
- platform: pm1006
pm_2_5:
name: "IKEA Vindriktning PM2.5 sensor"A few potato photos taken just before final assembly: |
|
@lassebm, thanks for sharing. I've just finished the soldering and realised that the possible 4 pin connector at the end of the board would make things far more easier, but unfortunately IKEA hasn't fitted that. |
|
I have now also tested this with ESP32, and it works there too. |
I soldered my connections to these connector pins. Works fine 👌🏻 |
I wanted to test this, but you did first 😃. Can you use any esp32 gpio, or it should be the rx esp32 gpio? Thanks for everything |
|
I wanna test if i can use the output fan of the Ikea pcb applying 2 resistors to reduce the 5V to 3.3V. In that way the fan wouldn't work all the time |
The fan @ 5V is hardly noticeable. It doesn't spin all day and frankly, i didn't modify it but I don't hear it either.. |
Mmm. Does it not disturb you? Its a bit annoying |
My notebook's fan louder than the one inside the device. Where are you using that you can notice the fan? |
In my bedroom 😭 |
Sorry for that... I have an old winding clock which ticks quite loud (and hits half and full hours), during summer a fan type mosquito trap running all night as well, plus the air purifier. All just creates white noise... And that one is good for sleeping. |
|
Everybody, please take the show-off and discussion of your builds somewhere else (such as a discussion, Discord or the HA forums), so that we can keep this PR focused on the code. Having to scroll through 50 off-topic comments and lots of images doesn't help to get a quick review ;) |
|
Is there a bug with the last icon uploaded? I have tried to compile a firmware using esphome release branch and the pm1006 as external component, but i get this error: |
|
@sermayoral This happens because this PR also adds the icon to the ESPHome core, so the PR branch can't be used as an external component. |
Thanks @oxan. I have forked the PR branch changing the missing icon in order to use the pm1006 component as external component until it can be merged: |
|
Oops, sorry about that!
…On Sat, Jul 24, 2021, at 14:59, Oxan van Leeuwen wrote:
@sermayoral <https://github.com/sermayoral> This happens because this PR also adds the icon to the ESPHome core, so the PR branch can't be used as an external component.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#2038 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAEAMDUS6UATYSHM2VGIYPTTZK2LBANCNFSM5AUKJPSA>.
--
Peter van Dijk
***@***.***
|
Don't worry, minor solved problem, and thanks for your work!! |
I've created a topic in the HA forum referencing this PR. https://community.home-assistant.io/t/ikea-vindriktning-air-quality-sensor/324599 @Habbie - if you do have a HA forum account, can you please just post there a comment and I will update the tag? |
OttoWinter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 I haven't read through the entire thread, but this integration is ready to go right?
Hi @OttoWinter, this PR ir ready to merge, but the Doc PR should change the IMG to avoid using the IKEA one due to copyrights |
Habbie/esphome-docs#1 should fix that issue. |
merged, thanks! |
|
Anything else that needs to be done to get this merged? |
I can confirm this. |
@nohn use my branch until this PR is merged |
|
Hi, quick question I seen online that this sensor can read more than 2.5 PM and can at least read 1PM and 10 PM. Are you guys integrating the later 2 readings or just staying with single 2.5 PM? Found this in case it helps for anything: https://github.com/bertrik/pm1006k. |
It is a PM1006 sensor and NOT the PM1006K. |
|
@GSzabados Hi I got it but on the pdf you sent it states sizes between 0.3μm to 10μm. But yeh.. I might look for a different and more complete. sensor. Thanks anyway. |
|
@Habbie I think you shouldn't name this hack PM1006. Your implementation only works if you connect the ESP to the VENDRIKTNING pcb. If you connect it to the PM1006 directly, which has RX/TX UART, you won't get any measurements without first sending the right command. See: http://www.jdscompany.co.kr/download.asp?gubun=07&filename=PM1006_LED_PARTICLE_SENSOR_MODULE_SPECIFICATIONS.pdf |
|
That's correct. I modeled it like the SDS011 driver, which can operate on RX/TX mode, or in RX-only mode. As I was unable to test RX/TX mode, I only implemented RX-only mode, and for now we don't have a flag to choose - as there is no code RX/TX mode. I fully trust that somebody, perhaps me, will contribute TX/RX support soon, to the same component. It seemed pointless to me to -not- call this one pm1006 if it's going to mostly have the same code as a full pm1006 component. (Also, it's a bit late, it's already merged). |









What does this implement/fix?
This adds ESPHome support for the IKEA VINDRIKTNING. Some inspiration taken from https://github.com/Hypfer/esp8266-vindriktning-particle-sensor
The implementation is heavily based on the existing SDS011 implementation - mostly the parser is different.
Types of changes
Related issue or feature (if applicable): none
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#1315
Test Environment
Example entry for
config.yaml:Checklist:
tests/folder).If user exposed functionality or configuration variables are added/changed: