Ikea Dirigera integration

so I had it running for almost 2 days, with all on the new Dirigera via Homekit, except for the 2 Starkvind air purifiers I have. these were still on the Ikea Gateway.

Until today it lost connection once more, and integration needed to be reloaded, etc etc.
completely fed up with that now, I decided to also add those Purifiers to the Dirigera, and Homekit setup.

which is nice, except it changes the PM sensor in mg to a 1,2,3 state sensor, also no issue.
however there are no fans (or switches to change into fans), and no speed indicators.


Sadly the Homekit integration fails to import all of those, so making that practically uselessā€¦

edited the above, as I was too soon, and all is well now, except for the battery sensor entities on switches. And: STABLEā€¦ cant underestimate that .


meaning I end up with a failing Ikea Integration, which is the only integration actually seeing those entities.

So, we ā€˜needā€™:

  • a fix for the existing Ikea Integration
  • a new Dirigera Integration
  • more support in HomeKit for those battery sensors on switches, and at least these fan entities with their longevity and quality sensor entitiesā€¦
1 Like

Hi everyone,

My first post after joining the forum so hopefully someone finds this useful.

Iā€™ve been using HA for six weeks. It is superb, especially the number of available integrations and friendly forums.

Iā€™ve managed to integrate the Dirigera Hub in Home Assistant via Apple HomeKit (which is running on my Apple 4K TV). I run HA in a docker (via Synology) so Iā€™m not able to use the various USB Zigbee dongles. I selected TRADFRI in the integration as DIRIGERA was not available.

The devices were then added in the new IKEA Smart App and they appeared in
HA within a couple of seconds (after some automatic device firmware updates).

I donā€™t actually use Homekit but it does help integrate a number of devices including Dirigera.

Iā€™ve tested many of the Ikea Smart devices (with lots of frustration) and have the following results.

The following devices all work perfectly (with latest firmware).

VALLHORN Motion Sensor (great value at Ā£7 sterling)
PARRASOL Door Sensor (great value)
SOMRIG Button Controller (you get six buttons in HA with double click & hold)

The following DO NOT work

RODRET Switch
STYRBAR Switch and dimmer

Maybe someone with more knowledge can advise but it seems the devices which work are the new ones, and theyā€™ve also had recent firmware upgrades. The devices which donā€™t work have older firmware. Perhaps they will get an upgrade so and start working in HA soon.

I was gutted I couldnā€™t get the STYRBAR to work as I wanted the one with the chrome finish for my cinema room.

I did originally buy the Aqara M2 hub but none of the Ikea devices were compatible, so I returned the M2 hub and purchased the Dirigera. Ikea has better remotes and the new VALLHORN sensors work great. The Aqara motion sensors do look better (and monitor Lux) but they are three times the price of the Ikea Sensors. The PARASOLL door sensors are also great value and work perfectly.

Hope this helps someone with similar questions.

Cheers,
Tone

none of the Ikea switches are exposed by Dirigera, so HomeKit can not integrate them.
Ive recently, (during the last 5 days in the latest beta) migrated from Ikea to Dirigera/Homekit, and noticed that too.

Having said that, we only lose the battery entities on those switches, as the original Ikea Integration doesnā€™t create switch entities, or any other type we have in HA (think button) for those.

All motion sensors work out of the box (better than in Ikea integration) as we now also get binary_sensor for them

In a current PR (already merged) we have the air purifiersā€¦
So for now its the best we can do (beside maybe move the switches to ZHA on a separate Zigbee dingle to get their batteries back)

I would be interested if you could show how the new devices you mention are integrated. Would you please post an image of the device page in HomeKit for them?

Apologies for the delayed reply, only just seen your message.

Hopefully this is the screenshot you need.

1 Like

Thx. Please post a detailed shortcut button page? So we can see if there is more than only a battery? Hopefully something to trigger from in an
Automation

Would love to see the door sensor too

Just bought some ikea lights, remotes, and air quality sensor with the assumption the it would integrate straight with HA, looks like I was wrong.

After some initial searching this looks promising:
https://github.com/sanjoyg/dirigera_platform

Anyone look into this? I will have to find some time to play around with this.

3 Likes

Just added support for Blinds and Controller, though its experimental. Would need help with the JSON dump of anything breaks.

1 Like

Did anyone give the guy a hub yet?

Iā€™m already using it for about a week. Iā€™m new to Home Assistant. I had no issues with the detection of the gateway. I have bulbs, tradfri sensors and driver (2 sensors, 1 driver, 20 bulbs). Iā€™m not using a Zigbee dongle, Iā€™m running Home Assistant on an old laptop, so basically communication is through the network. Iā€™m guessing the remotes are detected only with a Zigbee dongle so I canā€™t give my feedback on that.

My only issue at the moment is that when I turn on multiple lights through Home Assistant (for example: a whole room), they start one by one and not all at once. I did try using light groups but that didnā€™t help. Iā€™m unsure if itā€™s my fault or if itā€™s something with the integration.

That is interesting. Possibly because it has sync function. Will experiment with async instead and let know.

1 Like

The Fyrtur roller blind (FW 24.4.13, product id E1757-140) does not seem to work. It shows up, but the up and down buttons are greyed out, here is some errors from the log (I have two of them so some things may be duplicated):

Error adding entities for domain cover with platform dirigera_platform
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 782, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1325, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 989, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1110, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1047, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 995, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 311, in state
    if self.is_opening:
       ^^^^^^^^^^^^^^^
  File "/config/custom_components/dirigera_platform/cover.py", line 104, in is_opening
    if self.current_cover_position() is None or self.target_cover_position() is False:
Error while setting up dirigera_platform platform for cover
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 352, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 782, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1325, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 989, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1110, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1047, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 995, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/cover/__init__.py", line 311, in state
    if self.is_opening:
       ^^^^^^^^^^^^^^^
  File "/config/custom_components/dirigera_platform/cover.py", line 104, in is_opening
    if self.current_cover_position() is None or self.target_cover_position() is False:
Error adding entities for domain sensor with platform dirigera_platform
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 642, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.helpers.device_registry.DeviceRegistry.async_get_or_create() argument after ** must be a mapping, not SensorDeviceClass
Error while setting up dirigera_platform platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 352, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 642, in _async_add_entity
    device = dev_reg.async_get(self.hass).async_get_or_create(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: homeassistant.helpers.device_registry.DeviceRegistry.async_get_or_create() argument after ** must be a mapping, not SensorDeviceClass

After update to 1.3.1 I also got this message in the log:

This error originated from a custom integration.

Logger: custom_components.dirigera_platform
Source: custom_components/dirigera_platform/cover.py:129
Integration: IKEA Dirigera Hub Integration (documentation, issues)
First occurred: 14:52:14 (260 occurrences)
Last logged: 15:24:29

6 validation errors for EnvironmentSensor attributes -> currentTemperature field required (type=value_error.missing) attributes -> currentRH field required (type=value_error.missing) attributes -> currentPM25 field required (type=value_error.missing) attributes -> maxMeasuredPM25 field required (type=value_error.missing) attributes -> minMeasuredPM25 field required (type=value_error.missing) attributes -> vocIndex field required (type=value_error.missing)

can you open an issue at github for me to fix it. and would need the json dump

The up and down buttons on the blinds actually started working after the update (or around there), despite the error messages. Also, I am sorry, but I cant supply a json dump. I followed the instructions to invoke the command, which seemed to succeed. But I have no idea what the ā€œHASS logsā€ are, is that some addon? I tried looking in the logfile for Home Assistant (in the settings > system > logs), but there is no related json data there relating to this addon around the timestamp the command was invoked.

The logfile though just keep repeating this error over and over for both my blinds:

2024-03-14 09:18:40.052 ERROR (SyncWorker_19) [custom_components.dirigera_platform] error encountered running update on : xxxxxx
2024-03-14 09:18:40.053 ERROR (SyncWorker_19) [custom_components.dirigera_platform] 6 validation errors for EnvironmentSensor
File "/config/custom_components/dirigera_platform/cover.py", line 126, in update
File "/config/custom_components/dirigera_platform/dirigera_lib_patch.py", line 54, in get_blinds_by_id
File "/usr/local/lib/python3.12/site-packages/dirigera/devices/environment_sensor.py", line 36, in dict_to_environment_sensor
return EnvironmentSensor(dirigeraClient=dirigera_client, **data)
File "/config/custom_components/dirigera_platform/cover.py", line 130, in update
homeassistant.exceptions.HomeAssistantError: (ValidationError(model='EnvironmentSensor', errors=[{'loc': ('attributes', 'currentTemperature'), 'msg': 'field required', 'type': 'value_error.missing'}, {'loc': ('attributes', 'currentRH'), 'msg': 'field required', 'type': 'value_error.missing'}, {'loc': ('attributes', 'currentPM25'), 'msg': 'field required', 'type': 'value_error.missing'}, {'loc': ('attributes', 'maxMeasuredPM25'), 'msg': 'field required', 'type': 'value_error.missing'}, {'loc': ('attributes', 'minMeasuredPM25'), 'msg': 'field required', 'type': 'value_error.missing'}, {'loc': ('attributes', 'vocIndex'), 'msg': 'field required', 'type': 'value_error.missing'}]), 'dirigera_platform', 'hub_exception')

Edit: I opened an issue on github with the above info.

Trust this is fixed now

If the issue is fixed, do post it in community to increase adoption

Version 1.3.3 fixed it.

Ikea released a new version of their app, and now the Dirigera hub supports Matter. Though as of now only for lights, itā€™s a great step.
You can quite easily set up your HA as a Matter controller, and the Dirigera as a bridge. All your lights will then be visible in HA, easy as that.

You can set up the Dirigera for matter in the workshop in the app (tap the person-icon at the bottom, and scroll way down to ā€˜The Workshopā€™ at the bottom, and activate the ā€˜Matter Bridge integrationā€™)

2 Likes

Interesting ! And yes I did the update . Up to now have all imported via HomeKit devices so not sure if going directly over Matter would be better?

The docs doing that are so dauntingā€¦

Since I have more devices than lights: could it be done both ? Lights via Matter and other devices via HomeKit maybe ?

@sanjoyg : great work, I love this! Seems like a nice integration already! Are you looking into getting this built-in HA like Tradfri, or only as a custom component?

Also: did you by any chance also already have the Badring (water leak sensor) and would it be able to add support for that one? I think itā€™s a new device still, like the door sensor? Or do these count as the ā€œopen/close sensorā€ compatibility?

Thanks!