Hue motion sensors + remotes: custom component

Thanks for all your work!

Do you have a solution for:
I have installed the component but am getting very slow responses on switching a hue light in the frontend.
Also my log is full of “update taking longer than the scheduled…”
By the way my whole log is filled with “update took longer than…”, for various entities. Still got one of the fastest SD cards around (Sandisk Extreme)

Sounds like a network issue to me. I would check how the Hue Android/iOS apps perform. Please note that this custom component (for sensors/remotes) and the lights component are using different libraries.
Cheers

Thanks for your response. I’ve connected the pi via wifi, maybe a LAN connection will do the trick.
Will let you know if this helps!

Will this custom component be affected by the breaking change for hue in the upcoming 0.60 home assistant release?

Refactor hue to split bridge support from light
platform (@andreacampi - #10691) (hue docs) 
(light.hue docs) (breaking change) (new-platform)

No idea, but if it does should be a quick fix.
The refactor was done so that the remote component could be integrated with the lights component more seamlessly.
Cheers

1 Like

HI all, just pushed v0.2 which resolves issues due to the breaking changes in HA 0.60. Note that you need to update your config.
Cheers

1 Like

Does the hue.py in custom_components go away and replaced with just the hue_sensor.py in custom_components/sensor?

Thanks

Yes delete it. Cheers

Many thanks kind sir!!

1 Like

I am having some issues with this now. I have upgraded to 0.60 of hass.io. I deleted the hue.py code in custom_components and downloaded the new version and saved it into custom_components.

I have the following in my sensors

- platform: hue_sensor

And

  - platform: template
    sensors:
      living_room_temperature:
        friendly_name: 'Living Room Temperature'
        entity_id: sensor.living_room_motion_sensor
        value_template: "{{ states.sensor.living_room_motion_sensor.attributes.temperature }}"
        unit_of_measurement: '°C'
      living_room_lux:
        friendly_name: 'Living Room Lux'
        entity_id: sensor.living_room_lux
        value_template: "{{ states.sensor.living_room_motion_sensor.attributes.lux }}"
        unit_of_measurement: 'lux'
      kitchen_temperature:
        friendly_name: 'Kitchen Temperature'
        entity_id: sensor.kitchen_motion_sensor
        value_template: "{{ states.sensor.kitchen_motion_sensor.attributes.temperature }}"
        unit_of_measurement: '°C'
      kitchen_lux:
        friendly_name: 'Kitchen Lux'
        entity_id: sensor.kitchen_motion_sensor
        value_template: "{{ states.sensor.kitchen_motion_sensor.attributes.lux }}"
        unit_of_measurement: 'lux'

But I have now lost all my sensors and have a massive error log. If I comment out platform: hue_sensor and reboot all my other sensors return but obviously no HUE sensors.

Does this component work with hass.io v0.60?

Thanks

Under hassio with 0.60 I also go the error unable to find hue_sensors, which I believe is due to hue_sensors not being installed.

Solution: download hue_sensors.py and place in custom_components/sensors, restart hassio

Cheers

OK cool. So we need both hue_sensor.py and hue_sensors.py ?

I now have both but still doesn’t work :frowning: I have lost all my sensors and the error log is hundreds of lines long complaining about hue_sensor.py. Don’t think as it’s so long I can post here.

Hi, yes they are both required if you are getting errors about missing hue_sensors.
Please create an issue on GitHub with your error logs.
Cheers

OK logged an issue on github

Very strange…

I can see the sensors but no Hue lights appear on my overview page after upgrading. Is this related to the custom component or do I have another problem?

/Kaspar

That’s what I get. As soon as I installed the component all my sensors disappeared not just HUE stuff.

Please make sure you have removed all of the files from the earlier version of the library. There should now be only a single .py file in custom_components/sensors.
Cheers

thank you very much for your work and the library, but please make up your mind and don’t add more confusion :slight_smile:

as far as i can tell by looking at the github page the component was renamed from hue_sensors to hue_sensor (at least in my case i had an old file namend hue_sensors).
The documentation should mention this.

Hi, please note that the custom component contains hue_sensor.py, and the docs state that if you are getting an error due to the failure of HA to install the dependency, then also add hue_sensors.py from this repo. I see it is confusing that they have almost identical names but it wasn’t my expectation that the user may need to have both in the same folder.
Cheers

Hi, is it possible to scan more often than once per second? I also tried the guide on hackster (https://www.hackster.io/robin-cole/hijack-a-hue-remote-to-control-anything-with-home-assistant-5239a4), but it seems I can’t set scan_interval lower than 1. And even then, sometimes it takes up to 2 seconds to update.