Skip to content
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

[FR] Add Sensirion SEN5x (IKEA VINDSTYRKA) #4794

Closed
TD-er opened this issue Sep 11, 2023 · 15 comments · Fixed by #4991 or #5038
Closed

[FR] Add Sensirion SEN5x (IKEA VINDSTYRKA) #4794

TD-er opened this issue Sep 11, 2023 · 15 comments · Fixed by #4991 or #5038
Labels
Type: Feature Request Add a completely new feature (e.g. controller/plugin)

Comments

@TD-er
Copy link
Member

TD-er commented Sep 11, 2023

The latest Ikea VINDSTYRKA air quality sensor uses the Sensirion SEN5x.
There are 3 types of this sensor:

Assuming the IKEA unit uses the SEN54, since photos only show values for PM, RH/T, VOC
image

@TD-er TD-er added the Type: Feature Request Add a completely new feature (e.g. controller/plugin) label Sep 11, 2023
@iz8mbw
Copy link
Contributor

iz8mbw commented Sep 11, 2023

@TD-er please replace "Senserion" with "Sensirion".

@TD-er TD-er changed the title [FR] Add Senserion SEN5x (IKEA VINDSTYRKA) [FR] Add Sensirion SEN5x (IKEA VINDSTYRKA) Sep 11, 2023
@tonhuisman
Copy link
Contributor

tonhuisman commented Sep 11, 2023

This guy Oleksii has a sort of tear-down for the device (more like an unboxing 😉), that confirms the sensor is indeed a SEN54.
There also is an official Sensirion Arduino library for the SEN5x (using I2C). Not sure if we can 'eaves-drop' on that, like is done with the Vindriktning plugin (that's using a more 'regular' serial interface). And maybe just implementing this in a more ESPEasy fashion, without introducing another 'standard' way of communication with I2C devices, is a better idea.

Edit: Here is the Sensirion SEN5x datasheet

@TD-er
Copy link
Member Author

TD-er commented Sep 11, 2023

Yep, was thinking about the same approach.
Problem is that we may need to 'sniff' to see if there is activity on the I2C bus.

@TD-er
Copy link
Member Author

TD-er commented Sep 11, 2023

Ah apparently someone else came up with the same idea: oleksiikutuzov/IKEA-VINDSTYRKA#1 (comment)

@andibaciu
Copy link
Contributor

Hello,
I am interested in IKEA Vindstyrka integration in ESPeasy and below is my research regarding it:

  1. here (https://github.com/just-oblivious/vindstyrka-docs) I found explanations about the communication between the IKEA controller and the SEN54 sensor
  2. in the attached XLS file, I tried to make my own assumptions about the MYSTERY WORD referred to in point 1 (there are explanations of how I assume the final temperature and humidity are calculated, which are also displayed on the Vinstyrka screen)
  3. I tried to develop a plugin for ESPEasy but I have some difficulties in activating an interrupt (interruption that doubles the SCL pin of the i2c communication in order to be able to see when the Vindstyrka controller ends the communication with the SEN54 sensor - in order not to disturb it communication, and to make the queries on i2c after this communication ends). If the communication between the Vindstyrka controller and SEN54 is not monitored, anomalies will appear in the display of the measured parameters on the Vinstyrka screen.

I hope to be able to activate the interrupt with your help and to be able to complete the plugin.

Note:

  1. The plugin is ONLY for the IKEA Vindstyrka controller (it is also not completed for SEN54 or SEN55 standalone)
  2. It is necessary that the name of the first task in ESPEasy of the "Air Quality - Sensirion" type be "IKEA_Vindstyrka" in case the definition of the second task is also desired to display the multiple parameters it can provide.

sen5x_logging_data.xlsx
zip.zip

@TD-er
Copy link
Member Author

TD-er commented Feb 21, 2024

I guess the Ikea firmware does try to read only on regular intervals, so maybe we can detect this and try to match its read interval, not to disturb those readings?

Another way can be to add a second I2C bus and try to emulate the device on this 2nd bus and thus act as some kind of man-in-the-middle and echo'ing the values while keeping the read results.

N.B. a 2nd bus is probably only limited to ESP32-like devices.

@TD-er
Copy link
Member Author

TD-er commented Feb 21, 2024

Ah this emulation was also mentioned on the link you provided.
Meaning this could be turned into 2 plugins:

  • Reading the sensor
  • Adding a specific display where we emulate the sensors to show arbitrary values like on any display.

@tonhuisman
Copy link
Contributor

The SEN55 sensor is planned to be included soon, using the I2C bus.

@andibaciu
Copy link
Contributor

andibaciu commented Feb 21, 2024

Hello,
from the research of the person who made the sniffing, it is clear that the query of the SEN54 sensor by the IKEA Vinstyrka controller is done at regular intervals of 1 sec.
I like the idea of "man in the middle" but I would prefer that ESP8266 users can also benefit from this plugin (including myself).
I hope I can solve the problems with the interrupt activation on the SCL monitoring pin. I don't know how to try to activate this interruption, so far everything has been unsuccessful.

@TD-er
Copy link
Member Author

TD-er commented Feb 21, 2024

If someone wants to modify such a unit, then quite often new hardware has to be bought.
So why buy any ESP8266 right now if the ESP32-C3 (as example) costs less money, is smaller and has much less power and antenna related issues compared to those "Wemos D1 mini" ESP8266 form factor boards you get when ordering now from Ali et. al. ?

@andibaciu
Copy link
Contributor

The SEN55 sensor is planned to be included soon, using the I2C bus.

@tonhuisman is about standalone SEN5x or in this category is included IKEA Vindstyrka device ??? (because for IKEA device it's necessary to not affect original (main) communication).

@TD-er
Copy link
Member Author

TD-er commented Feb 21, 2024

The pending implemented PR is not taking into account that there might be other concurrent I2C transfers.

It is quite hard to manage 2 masters on the same I2C bus.
Maybe the IKEA firmware does allow to sometimes have no connection to the sensor?
If so, then you could add some "analog switch" chip to switch connection from ESP to IKEA PCB?
But I think the most stable and elegant solution would be to consider the IKEA PCB as a display.

@andibaciu
Copy link
Contributor

i make some progress for this ESPeasy plugin (for ESP8266)
All description and files could be find here: https://github.com/andibaciu/ESPeasy-plugin-for-IKEA-VINDSTYRKA
Best regards!

@TD-er
Copy link
Member Author

TD-er commented Feb 24, 2024

Why do you use P253?
You can just request a plugin ID: #3839
And why not directly make a pull request?

@andibaciu
Copy link
Contributor

andibaciu commented Feb 24, 2024

Sorry, my mistake, i dont know about this request a plugin ID: #3839 (it's my first contribution for this project) and i post about this plugin only here.
I already make a plugin request and after the owner give approval for this plugin and allocate a number i'll make all necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request Add a completely new feature (e.g. controller/plugin)
Projects
None yet
4 participants