Philips Hue Motion custom components

Hi,

I’ve searched for information regarding how to set-up Philips Hue Motion sensors in my fresh install.
I found some links pointing to github and as far as I understood I need to create a custom component.

However these posts are a bit old and I was wondering what is the best approach to use the Philips Hue Motion Sensors at this point in time?

Thanks

There is a custom component made by RobMarkCole which I used for a long time and worked really well, but then recently it randomly stopped updating the sensors after a random amount of time.

I ended up manually creating sensors using the REST api, which is working flawlessly but is an awful lot more work.

The custom component still works for many, so I’d give that a go first :slight_smile:

1 Like

Thanks for taking the time to reply.

I believe I found the component you recommend here https://github.com/robmarkcole/Hue-sensors-HASS.

I’m really struggling to find proper documentation about how to install and use.

Using the samba add-on I’ve placed the custom_components folder in the configuration directory… but now I have absolutely no clue about what to do with this.

Any pointer would be greatly appreciated, just finding the proper documentation about a topic is already challenging in itself…

Thanks

You need to create a sensor folder inside the custom_components folder. The hue.py goes there. I am using the component for the dimmer so I can’t help you on the motion sensor.
I would start reading https://community.home-assistant.io/t/hue-motion-sensors-remotes-custom-component/ You can search through that thread for motion related configs.

1 Like

@zarthan thank you!

Actually I already have the sensor within custom_components and the python script is inside as well. I’m just not sure about what to do next. I’ll go back to the thread you mentioned

A python script isn’t part of this custom component.
The thread is long and there were many changes along the way. At one point there were two files as part of the component. Once you have included the following in your configuration and restarted HA the sensor should show up in the developer tools <> menu. There should be lots of example configuration snipits in that thread.

sensor:
  - platform: hue
    ip_address: x.x.x.x
    token: xxxxxxxxxxxxxxxxxxxxxxx
1 Like

The instructions on how to implement and use the component are in the Readme page…

Hi @anon43302295,

Thanks for taking the time to reply. I’m well aware of this page and spent quite some time on it actually.

I’m not sure what is the intended audience of Hassio but I’ve been working in the IT industry for about 15 years. I’m not a developper nor a sysadmin but this is one of the worst/most challenging software I ever came across from a UX standpoint.

I would be more than happy to contribute and create a user friendly version of the readme file, you know user tested and all that stuff.

So first step is “Place the custom_components folder in your configuration directory (or add its contents to an existing custom_components folder)”

This sounds obvious but imagine a complete newbie like I am, this is missing quite a lot of context. I mean, setting-up Samba or SSH add-ons first and actually understanding you won’t be able to use the wysiwyg and you need to start playing with config files, folders etc.

Second step “You need to configure your Hue bridge IP and developer key, see this link for instructions.”

At first sight the article looks kind of related but not really on point. After scrolling through it, in the middle you find “In order to use RESTful commands with the Hue hub you will first need to generate an “Authorized Username”. You can retrieve the user name using CURL (note you will have to press the button on the Hue hub first):”

I’m reading this article in order to learn how to find a “developer key” and now I see it might be what is called “Authorized Username” in the article, I guess it’s the same thing, is it?

So now I’m running this command:
CURL -X POST -d ‘{“devicetype”:“my_hue_app”}’ http://my_local_IP/api --header “Content-Type:application/json”

I get a long series of digits so I guess I’m fine until this stage.

Now last but not least, last step is “Hue dimmer remotes can be used for a click and long press (hold button for 2 sec and see LED blink twice).”

Well hmmm… wait… what am I supposed to do at this stage? Thanks to @zarthan I understood I now could go and play with the config file, restart hassio and hang around the developper tools menu so I can get my sensor over there. But still I have absolutely no clue regarding what I’m supposed to do.

I’ve spent a large amount of time going through all the documentation I could find, but I miserably failed to make a mental representation of what is a “custom component” even though I believe I used the right keywords.

Don’t get me wrong, I appreciate you’re taking the time to help and contribute, I also admire the entire team working on the product but I just wanted to share some part of my user journey so far which has been very disconcerting.

I’d be more than happy to contribute and propose a more user oriented, Krug tested version of the readme file if onboarding users like me is something the community is open to do.

I believe there’s a massive potential for Hassio but sooner or later a contender might show-up with a more user friendly approach and will take over the market by reaching critical mass much faster. That’s my opinion at least.

The Hue custom component isn’t a finished product. There have been many changes in this component and the libraries that it depends on. The developer will at some point create something that will become part of the main Home Assistant product but the developer recently moved and got married. Things get in the way some times. Do remember this project is volunteer driven. Not everyone has enough time for everything.

@zarthan I completely understand. I’m willing to help writing a fully detailed tutorial for newbies like me if it can help

I’m not sure that will help because the component isn’t going to be updated. The finished component will be the next stage. Any questions you might have would be best addressed in [https://community.home-assistant.io/t/hue-motion-sensors-remotes-custom-component/ and feel free to ask @robmarkcole about helping out.