Hue motion sensors + remotes: custom component

Yes, restarted several times.
Does anything still need to be activated or installed?

Oh no, i feel so bad man. I found the misstake. The folder “custom_components” had a space at the end. Sorry. :roll_eyes: All is working fine.

OK a heads up that I recommend people checkout the HACS custom components package manager by @ludeeus My plan is to drop support for the custom_updater in a month, as HACS is this way updates should be managed going forward.
Cheers

3 Likes

Will there be some sort of migration guide to help us less skilled folks on how to keep your custom component updated using HACS?

I installed it - not sure if you’re already using it to push updates.

Thanks!

Please follow the HACS docs, there is nothing special to be done for this CC

Sorry I guess I don’t understand. Hopefully otherS will post with some help.

Thanks!

  1. Install HACS ( https://custom-components.github.io/hacs/installation/manual/ )
  2. Click the new ‘Community’ item on the left sidebar (on mine: after History and before Configuration)
  3. Click the STORE tab along the top.
  4. Find and click on Hue Sensors (if you can’t find it, follow the alternate steps below)
  5. Click INSTALL
  6. Add your configuration.yaml settings if you haven’t already.

I didn’t see Huesensor listed in the STORE page or the Github repositories/integrations list, but you can add it manually:

Alternate steps:

  1. Click the SETTINGS tab along the top.
  2. Under CUSTOM REPOSITORIES, click in the “ADD CUSTOM REPOSITORY” field and enter GitHub - robmarkcole/Hue-sensors-HASS: Support for Hue motion sensors and device tracker,
  3. Select type Integration and click the Save (floppy) icon.
  4. You’re taken to the Hue sensor custom component overview page. Click INSTALL.
6 Likes

Awesome! Thank you very much for this. I followed the first half and expected to see Hue Sensors, didn’t see it and that’s why I came back here… But thank you for sharing these steps.

Any idea if there are steps we need to take to remove or update, if I already have Hue Sensors installed?

Thanks again!

If it was installed under custom_components/huesensor, then I don’t think you’ll need to do anything special. HACS in general needs custom_components to be writeable by the hass user, if it wasn’t already.

2 Likes

k - I had it under custom_components/hue_sensor … So I may have to reconfigure some stuff.

I do have al really good experience with this cc!

Although i hope someone has a better way of using the Hue remote in the following scenario:

Beforehand, excuse me if this question is already asked, i have searched for something similar but i could not find it.

I have bought a hue dimmer remote to control my Sonos system by pressing the top button to fire a script to start playing radio on my Sonos.
The second button i use to increase volume, the third to decrease the volume and the last and fourth button to let my Sonos sleep.
All above actions are done by very simple automations.
The first button triggers on the Hue remote sensor to change from “something” to 1_click_up. This also works for the fourth button.

The issue i have is that when i’d like to increase of decrease the volume by short clicking on the second or third button the automation to actually do that only gets fired once because the state does not change, so i have nothing to trigger from if that makes any sense:)

For the second and third button i use a automation that triggers on everything that the sensor can have as a state. So from “something” to 2_click, 2_click_up, 2_hold and 2_hold_up. In reality this is just holding the button and releasing the button so the volume gets increased slowly because the automation gets fired more than once because the states changes a couple of times holding and release the button.
This automation has been set up for the third button the exact same way.

Maybe my automation is too simple. Right now i’m just triggering the state of the entity_id of the Hue remote sensor, and then fire the action to do a media_player.volume_up to entity_id of my Sonos.

I’d like to use the second and third button more like an actual volume button.
For example, it would be really nice to just hold the button while the volume increases or decreases or clicking once at a time to increase or decrease the volume.

The “problem” right now is that the sensor will stay on the last state that has been triggered by the device.

I hope my issue makes any sense and i really hope someone could point me into the right direction.

Thank you in advanced!

It’s actually quite easy to trigger an automation even if the state doesn’t change. I mentioned it in post #737, and there’s more details on GitHub, here.

1 Like

Really appreciate your reply!

So for my own understanding:

How can a automation be triggered if there is no state change and the actual button press cannot be detected because “nothing actually happens”? It does not make sense to me, but i’m sure you know how this works :smiley:

Thank you!

I have two philips hue tap switch. In the Philips environment, they both work perfectly.
I use the Hue-sensors-HASS to bind the Philips switches. One Tap Switch works perfectly and the second is not displayed in the Home Assistant or can not be found.
Can anyone help me with what that might be?

Even though the state doesn’t change the last_updated does change, which is a state attribute. So, like the documentation says

If only entity_id is given trigger will activate for all state changes, even if only state attributes change.

Then you check the state in the condition section to filter out which button press you want.

1 Like

I have tried the automation without the “from” “to” fields in the trigger and only use a condition and that did the exact thing i was hoping for!! brilliant!

Thank you very much for your help, this little project also got “the wife approval” now :smiley: haha!

1 Like

Can somebody help me? I get this error all the time:

2019-07-12 16:37:42 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 179, in _step
    result = coro.send(None)
  File "/home/homeassistant/.homeassistant/custom_components/huesensor/device_tracker.py", line 98, in async_see_sensor
    zone_home = self.hass.states.get(zone.ENTITY_ID_HOME)
NameError: name 'zone' is not defined

I’m using Home Assistant in Version 0.95.4 and installed it on Raspberry Pi in a Python VENV

Thank you

its a known issue , see: new device_tracker shows Zone not defined · Issue #151 · robmarkcole/Hue-sensors-HASS · GitHub

1 Like

Any update on what is going on with the official hue integration and this one? They seem to be living awkwardly together for now. Bonus info on the new HACS system which I have installed and configured so thanks for mentioning that stuff.

I don’t think the official is ever going to work well, with their current train of thought. Stick with CC.

1 Like