Kane610/deconz

Feature request: expose more IKEA Starkvind functions to Home Assistant

Opened this issue · 38 comments

As originally reported here: home-assistant/core#74788 the IKEA Starkvind when paired through deCONZ with the deCONZ Home Assistant integration only exposes one (1) air quality sensor. deCONZ reports more clusters available, but these aren't available in Home Assistant.
image

Requested features

A few examples of expected functionality from the official IKEA Home Assistant integration:

  • Fan control
    • Speed
    • Preset Mode
  • Air quality in ug/m3
  • Filter time left in hours

image

Additional features seeminly available through the deCONZ REST API / cluster, but also not exposed to Home Assistant:

  • Lock controls
  • Enable/disable LED
  • Replace filter

REST API:

{
  "state" : {
    "deviceruntime" : 95750,
    "speed" : 20,
    "lastupdated" : "2022-07-09T10:00:34.289",
    "filterruntime" : 95750,
    "replacefilter" : false
  },
  "lastseen" : "2022-07-09T09:59Z",
  "ep" : 1,
  "swversion" : "1.0.033",
  "manufacturername" : "IKEA of Sweden",
  "type" : "ZHAAirPurifier",
  "uniqueid" : "cc:86:ec:ff:fe:83:25:fe-01-fc7d",
  "lastannounced" : null,
  "config" : {
    "reachable" : true,
    "locked" : false,
    "filterlifetime" : 259200,
    "ledindication" : true,
    "mode" : "auto",
    "on" : true
  },
  "modelid" : "STARKVIND Air purifier table",
  "etag" : "33e4719fd2bfe58ece3303b818ade420",
  "name" : "AirPurifier 187"
}

Screenshots from deCONZ:

image

image

image

image

Thanks! There are still aspects of the integration that will need refactoring before I will expand it with more features but this will definitely be added.

Hi there, may i humbly ask if there is any news?

Hi there, may i humbly ask if there is any news?

Yes. I should get back to this. :)

As listed in the changelog for deConz v2.24.1 beta a DDF was added for IKEA STARKVIND Airpurifier, also discussed here: dresden-elektronik/deconz-rest-plugin#7248
But after updating deConz to v2.24.1 Beta, nothing new appeared in HA related to the STARKVIND.
What should be expected? Does the new DDF bring anything at all?

As listed in the changelog for deConz v2.24.1 beta a DDF was added for IKEA STARKVIND Airpurifier, also discussed here: dresden-elektronik/deconz-rest-plugin#7248 But after updating deConz to v2.24.1 Beta, nothing new appeared in HA related to the STARKVIND. What should be expected? Does the new DDF bring anything at all?

Replacing a C definition with a DDF definition shouldn't necessarily bring more functionality, it depends on the scope of the DDF. There is also a change in a type which pydeconz does not yet support.

Can you enable debug logging in the deconz integration in home assistant and share the the output from the log so we can see all reported data for the Starkvind device?

Log enclosed.
The funny thing is that it is no longer visible as a device in the deConz integration at all. There are log entries for it, but it's nowhere to be found. But before upgrading to deConz v2.24.1beta, it was at least present and visible, but only with two fairly useless entities. So i am now accessing and controlling it directly using the API. It works ok, but isn't ideal.
image
home-assistant_deconz_2023-10-28T17-13-56.279Z.log

I don't see any print from pydeconz only pydeconz.websocket, during start up of home assistant you should see the full response with all devices from deconz in debug. Its a very long print that starts with HTTP request response

I don't know if you cut out the early parts of the log because I see 2023-10-28 09:04:04.428 WARNING (MainThread) [pydeconz.models] Unsupported device type ZHAParticulateMatter which should happening just after the call.

I don't know. All I did was to enable debug logging. Then I jumped around in HA and searched for deConz entities, before disabling debug logging, at which point it cam up automatically with the result which I saved as a file and included above.
Do I need to do something in particular to trigger the log entries you are requesting?

I don't know. All I did was to enable debug logging. Then I jumped around in HA and searched for deConz entities, before disabling debug logging, at which point it cam up automatically with the result which I saved as a file and included above. Do I need to do something in particular to trigger the log entries you are requesting?

You need to either restart home assistant after enabling debugging or reload the integration

OK, I just did a reload. Here it is. Sorry for my ignorance.
home-assistant_deconz_2023-10-29T13-00-25.974Z.log

OK, I just did a reload. Here it is. Sorry for my ignorance. home-assistant_deconz_2023-10-29T13-00-25.974Z.log

Thanks! That's the one I needed.

Are these still the only expected values of the device? The more explicit definition the better for me.

Controls

  • Fan control
  • Speed
  • Preset Mode

Sensors

  • Air quality in ug/m3
  • Filter time left in hours

Is that a question for me to answer?

Is that a question for me to answer?

Anyone wanting Starkvind features exposed in home assistant :)

Are these still the only expected values of the device? The more explicit definition the better for me.

I do have the STARKVIND device running here too, but I'm not exactly sure what you mean. If I'm totally OT, just ignore this:

Personally, I'm missing the "Air Quality" and "Filter replacement" value in your list (Like in @oywino's screenshot), but maybe these values can be interpolated by the already listed values.

Well, at last the ones you listed pluss those listed in my picture posted above.
We reminds me of my original question: What to expect from the STARKVIND DDF included in deConz v2.24.1 beta? I mean, someone did include it for a reason, right?

@Kane610 I know your time is limited, but are there any plans for the near future to get the missing values? Thanks in advance. :-)

Yes I feel a bit awkward not having done anything on this yet, I have a couple of bugs that needs to take priority and then I must do something about this :)

Could someone share an updated debug log from deCONZ integration so I do changes based on up to date information

I activated the debug logs and restarted HA. I hope this is the log you looking for.

home-assistant_2024-08-07T18-28-12.387Z.log

I activated the debug logs and restarted HA. I hope this is the log you looking for.

home-assistant_2024-08-07T18-28-12.387Z.log

Exactly, Thanks!

We reminds me of my original question: What to expect from the STARKVIND DDF included in deConz v2.24.1 beta? I mean, someone did include it for a reason, right?

I have no idea

So lets be clear about what should be implemented, no referencing previous posts lets build a new complete list

Controls
Looking at what is controllable, I'd say these three are just one control https://dresden-elektronik.github.io/deconz-rest-doc/devices/ikea/starkvind_air_purifier/#config-attributes

  • Fan control
  • Speed
  • Preset Mode

Sensors

  • Air quality in ug/m3. <-- This should already be available
  • Filter time left in hours <-- It would either be the runtime of the filter or a binary sensor telling to replace filter

From above it would seem its only controlling the mode (off/auto/specific speed) and the filter time left that are wanted

Current list would be:

Control

  • Speed/Mode

Sensor

  • Calculate remaining time for filter

Personally, I'm missing the "Air Quality" and

That should already exist as entity afaik

I agree to your new list and yes, AQ is already available.

Btw. is there a way to change the "off" value. Currently, it will default to 65.535 and therefore is messing up the history charts.

Btw. is there a way to change the "off" value. Currently, it will default to 65.535 and therefore is messing up the history charts.

Which off? The mode or the device state?

Which value will become 65.535?

Ah sorry. I was talking about the PM25 AQ sensor. Its value defaults to 65.535 when the speed is "off".

image

Ok. Which setting triggers this to spike? Maybe it is a bug in deCONZ or perhaps something that can be defined in the DDF to handle?

Im trying to template all data in the integration meaning it's hard to do a lot of special cases, better to fix as close to source as possible.

Okay thanks. Will check the DDF.

Okay thanks. Will check the DDF.

Bring your observation up with deconz devs, see if it is something that they can do

Im considering just exposing data as is, meaning not providing a sensor calculating time left but rather one sensor with filter time and a number entity that can configure filterlifetime and then a user can create a template calculating time left, thoughts on this?

If the filterlifetime number entity defaults to the currently used one, that's fine with me.

Thanks! Id prefer not to do too much logic in entities

How often does the filter time data get updated? Every second?

Not really sure how to check this. I do have a custom sensor which is using the filterruntime value and it's getting updated almost every 15 minutes

- platform: rest resource: <sensor uri> value_template: '{{ (value_json.config.filterlifetime -value_json.state.filterruntime) | multiply(0.000694) | round(2) }}' name: ISAP - Filter Remaining Days device_class: duration unit_of_measurement: d

image

Well ding the polling thing doesnt eeflect how often the value updates on the websocket. You could just enable debug logging for the integration and check the logs how often it gets updated.

Good News is that selecting fan mode has been integrated for th release of 2024.9 release but we need to figure out the filter runtime data before that gets merged