Hue motion sensors + remotes: custom component

Ah… that’s disappointing…
Me as well, the main purpose is to use the remote to control scenes in HA…
The only thing I could think of was to add the Hue bridge to my HomeKit and, since I map HA entities in my HK, assign the remote buttons from there…
But it’s hell doing it this way since I can,t just bring the remotes, i’m bringing EVERYTHING from my Hue (and they are already mapped from HA so a lot of duplicates…
If there was a way to only map the remotes it would be great…
Couldn’t think of anything else…
My last option, since I use a lot of Lutron Caseta as well, is to get the pro hub so i’ll be able to use the Lutron remotes in HA to do exactly this; assign buttons to scenes…

Those remote are really used in my home so I’m actively looking for a stable solution…

Hi,
the customer component changed to 0.9. Now my HA can’t find

sensor:
  - platform: hue

Anymore.
I can’t find what I have to change here or on github.
Can you please describe what I have to do.
Thx

Edit:
Here is the error i got:

INFO:homeassistant.util.package:Attempting install of colorlog==3.1.4
Testing configuration at /config
Failed config
  General Errors: 
    - Platform not found: sensor.hue
Successful config (partial)
1 Like

Same here. Whereas hass --script check_config return no error logs show the following error when hass is restarted:

Dez 30 21:55:38 schneekluth hass[12209]: 2018-12-30 21:55:38 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform hue
Dez 30 21:55:38 schneekluth hass[12209]: Traceback (most recent call last):
Dez 30 21:55:38 schneekluth hass[12209]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
Dez 30 21:55:38 schneekluth hass[12209]:     SLOW_SETUP_MAX_WAIT, loop=hass.loop)
Dez 30 21:55:38 schneekluth hass[12209]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
Dez 30 21:55:38 schneekluth hass[12209]:     return fut.result()
Dez 30 21:55:38 schneekluth hass[12209]:   File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
Dez 30 21:55:38 schneekluth hass[12209]:     raise self._exception
Dez 30 21:55:38 schneekluth hass[12209]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
Dez 30 21:55:38 schneekluth hass[12209]:     result = coro.send(None)
Dez 30 21:55:38 schneekluth hass[12209]:   File "/home/pi/.homeassistant/custom_components/sensor/hue.py", line 150, in async_setup_platform
Dez 30 21:55:38 schneekluth hass[12209]:     for key in data.data.keys():
Dez 30 21:55:38 schneekluth hass[12209]: AttributeError: 'NoneType' object has no attribute 'keys'

Lights though are working perfectly.

same here… :frowning:

Hi all, please try release 1.0

Just installed 1.0, still having the same problem.

HI @robmarkcole

since this is a new phase of your component, please let me ask:

  • does the new (no manual settings needed) version support multiple Hue bridges? Will it automatically find them without any settings in config?

  • tried to parse the new code, but think to see the motion sensor still is a regular sensor, not a binary_sensor? (as I thought your goal was before this new setup)

thanks, great to see the component developing, one of my most used parts in HA…!

@Jonathan_Johansson please open an issue on Github, or if you did which one?
@Mariusthvdb This should work with multiple bridges, but I don’t have multiple to test.

FYI the new code was contributed by user @yottatsa
This is a step towards an official component

1 Like

cool indeed, thanks!

any thoughts on the binary_sensor? will this still be aimed at?

do hope this doesn’t bring back the confusion needing 2 files both called hue.py…

one of the nicer developments of the latter versions was those 2 files weren’t needed any longer.

Yes a motion sensor should be a binary sensor. Gets a bit more involved as these sensors also do temperature and light level. The Hue API actually treats this as 3 seperate sensors, whilst in the custom component temperature and light level are attributes. Need to decide how best to do this (single or multiple sensors). Any thoughts from the community?

I think the motion sensor should be a binary sensor. The temperature and light level - each - should be a seperate sensor . At the moment I use template sensors to get the information (temp + light). This means there is no difference for me. Maybe you could introduce a true/false configuration entry if or if not the temp and light sensor should be created.

1 Like

Yes I think it does make sense to breakout temperature and light level as separate sensors as otherwise you have to create separate sensors anyway to use them

1.0 din’t change anything, still same issue as 0.9 (also, doesn’t update using custom update, had to do it manually)

Mon Dec 31 2018 06:07:50 GMT-0500 (heure normale de l’Est nord-américain)

Unable to find component sensor.hue

Error loading custom_components.sensor.hue. Make sure all dependencies are installed

Traceback (most recent call last): File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py”, line 92, in get_component module = importlib.import_module(path) File “/usr/lib/python3.5/importlib/init.py”, line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 986, in _gcd_import File “<frozen importlib._bootstrap>”, line 969, in _find_and_load File “<frozen importlib._bootstrap>”, line 958, in _find_and_load_unlocked File “<frozen importlib._bootstrap>”, line 673, in _load_unlocked File “<frozen importlib._bootstrap_external>”, line 673, in exec_module File “<frozen importlib._bootstrap>”, line 222, in _call_with_frames_removed File “/home/homeassistant/.homeassistant/custom_components/sensor/hue.py”, line 17, in <module> from …device_tracker.hue import TYPE_GEOFENCE ImportError: No module named ‘custom_components.device_tracker.hue’

2018-12-31%2006_10_18-Home%20Assistant

That error indicates the .py files aren’t present

Got the same error as mentioned above by @Jonathan_Johansson. Created a github issue:

oh, ok, so now I also need to add the device tracker one?
Just made it work by also adding the device tracker one in custom components…

This is confusing a bit…

Only required if you configure the device tracker

Well nothing was working until I added the device tracker one.
What exactly is the purpose of device tracker? I have motion sensors and hue remotes.

Got the same issue.

OK so my position on this CC is that the stable release is 0.8. I’m happy to accept PR that add new features people want, and will review the code but since there are no unit tests I can’t be sure there won’t be breaking changes for some users. I don’t have the time/energy/devices to make sure these new features works for everyone asap. Thanks