home-assistant-libs / pytradfri

IKEA Trådfri/Tradfri API. Control and observe your lights from Python. Examples available. On pypi. Sans-io.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starkvind Air purifier

michaelnimbs opened this issue · comments

Hello,
is it possible to support the new Starkvind air purifier?
Controlling the level (1,2,3,4,5 or auto) and especially reading the output of the current air quality would be interesting, the manual says:

Only in the IKEA Home smart app.
Indicators for air quality (PM 2.5):
Green: 0-35 / Good
Amber: 36-85 / OK
Red: 86- / Not good

I've connected it to my gateway and the output of the device dump is:

{
  "3": {
    "0": "IKEA of Sweden",
    "1": "STARKVIND Air purifier",
    "2": "",
    "3": "1.0.033",
    "6": 1,
    "7": 4364
  },
  "5750": 10,
  "9001": "Luftreiniger",
  "9002": 1633096623,
  "9003": 65551,
  "9019": 1,
  "9020": 1633096633,
  "9054": 0,
  "15025": [
    {
      "5900": 1,
      "5902": 2,
      "5903": 0,
      "5904": 259200,
      "5905": 0,
      "5906": 0,
      "5907": 5,
      "5908": 10,
      "5909": 2,
      "5910": 259198,
      "9003": 0
    }
  ]
}

Let me know if I can be of any further assistance.

@michaelnimbs that should definitely be possible. Do you have any other device paired with the gateway? If so, you could compare the output from that one with the code here for that device and then try to build the needle code for the Starkvind.

I've played around with it a little bit and confirmed the location of the air quality sensor data by blowing out candles and letting the smoke get into the air purifier 😃

Control/data array is obviously at "15025".

'5900' State/mode with

  • 0: off
  • 1: Fan level auto
  • 10: Fan level 1
  • 20: Fan level 2
  • 30: Fan level 3
  • 40: Fan level 4
  • 50: Fan level 5

'5905' Lock physical buttons on the device

  • 0: unlocked
  • 1: locked

'5906' LEDs on/off

  • 0: LEDs on
  • 1: LEDs off

'5907' Air quality sensor (PM 2.5)

  • Integer value as mentioned above (0..35 Good, 36..85 OK, 86.. Not good)
  • 65535: If the fan is off or during measuring time after turning on

'5908' Current fan speed

  • Integer value 0..50, I saw only a step size of 5

I haven't had the time to setup the development environment yet to send some commands and add the device type for the library.

Great work! Give the VS code button on the main page a try, it should get you up and running in minutes.

Very nice, just bough the table, let me know if there is some way I can help.

Let me know if you need help with the development, I am currently changing quite a lot in the library, and I believe adding support for the air purifier is interesting, however I do not have one, so I cannot test.

I implemented the blinds without having one a few years back so it’s quite possible. 😊

I encourage everyone to download VS code and use the link in the readme to get going working on this in less than five minutes. It’s a matter of copy/paste of existing code to get it to work.

I've setup my environment now and added the device type and writing commands works.
I think I'll be done tomorrow.

please do not forget to add tests, so the new one gets automatic tested.

@michaelnimbs fantastic! ♥️ As @janiversen pointed out, adding tests is a good idea (requirement) but that should be pretty straightforward too. If not, please let us know and we’ll try to help.

Hello

How to test this change? I download the master then replace the pytradfri folder I currently have (somewhere in homeassistant or python/site-packages) with the new one??

Thanks

@gillesserco you won't be able to add this as is to Home Assistant. For this to work you need to create the code that bridges this library with Home Assistant.

Hello, sorry I am lost: this library is not used to handle the Ikea devices currrently supported by home-assistant?

yes it is, but you need additional work in the tradfri integration (I am one of the codeowners).

Actually it is logical, the library “talks” with the device and the tradfri integration generates the UI.

Ok, good.
Thanks to yoy guys for the effort you make to bring us these fantastic softwares.
Looking forward to see the air purifier into HA...

@gillesserco I've suggested that this gets implemeneted into HA here: home-assistant/core#58295