Hue motion sensors + remotes: custom component

yes, but essentially, the hue hub and software thereon is largely under the control of Philips, they can change or whatever they want to this platform as it is an extension of their cloud.

If for example, they found a security issue, they would then force an update to the hub which could potentially break the api access (I had this happen to me about 3 times, to the point where philips just started reponding to my tickets by sending me a new hub…I have actually become quite friendly with some senior technicians at hue now through this. I have about 4 of them (hubs not engineers :wink: now lying around at home. ) I also had an incident whereby the hub would keep renaming and mixing up the names of my bulbs, causing endless headaches downstream (I have about 30 bulbs)

So whilst I know that there are loads of features (like the entertainment and switch functions) built into the hub, for me, it is much better talking to the zigbee network directly as opposed to via the hub, but each to the own… I thought I would simply share my humble opinion… :slight_smile: Like I said, I used the custom component from @robmarkcole and it worked brilliantly, my house just started getting very busy when I started to add the xiaomi kit, and reliability started failing to my bulbs… all my bulbs now work much better since I use conbee with xiaomi and hue and all other zigbee on the same network…

Interesting, I’ve had the exact opposite experience. I have 36 lights, a motion sensor, and 6 FOH switches on my Hue bridge and it has been absolutely rock solid. In 4 years I’ve never once had an issue controlling lights or anything of that nature.

I also have 5 sets of Lightify Gardenspots which were absolute crap when connected to the Lightify hub. I have 7 Keen Home vents which were absolute crap when connected to the Keen Home hub. I’ve since connected those 12 devices directly to Home Assistant with an Xbee and they’re much better, but still nowhere near as reliable as my Hue system. Heck, Home Assistant in general isn’t as stable, and I’m running it on an enterprise server with dual 16-core CPUs, 52GB of RAM, dual PSUs, etc.

As this point I’ve basically decided that I’m replacing all non-Hue Zigbee devices with Hue products or Z-Wave.

interesting… it all depends on so many variables, including your home wifi setup and channels, size of the property, type of hue bulb (v1,2,3 etc) etc etc etc… for me, I had 2 lights that will simply not connect to my hue hub regardless of what version bulb I was using - 1 outside the front door and the other outside the back door, each were quite close to another internal bulb… since I moved to conbee they connect no problem… everytime… I suppose it is simply trial and error until you find a way to appease the household connectivity anomaly gremlins… :slight_smile:

1 Like

FWIW I moved my motion sensors to Deconz too and find they are lightning - I don’t think that there was an issue with this plug in, I found that the Hue Hub kept going offline. Interestingly, the hub is still servicing lights only now (about 25 of them) and hasn’t gone offline once. Deconz is running on a standalone Pi.

Big thanks to @robmarkcole though for all his work on this - worked really well for the year or so I used it.

1 Like

I’m stuck with this. I have this automation to use the same Hue Tap Switch button to open and stop a cover at any point, not only a 100%. One click, it starts opening, next click it stops. Basically, the template reads the state of the cover and only activates cover.stop when it detects it is opening, otherwise it opens. Now according to @Caladera here, I’m using 4_click as a condition, not as a trigger, because otherwise there is no change in "to:" when pressing the same button.

My problem is, since the trigger is the state change of the cover, once the cover stops and changes from “opening” to “open”, the automation runs again and cover.open fires once more. So basically the cover stops for a second and keeps opening.

Any help?

- id: '1560748807274'
  alias: Office Tap Switch Button 4
  trigger:
  - entity_id: sensor.tap_switch
    platform: state
  condition: 
    - condition: state
      entity_id: sensor.tap_switch
      state: 4_click
  action:
  - service_template: >
        {% if is_state("cover.shelly_shsw_25_0047f0", "opening") -%}
          cover.stop_cover
        {% else %}
          cover.open_cover
        {% endif %}
    data:
      entity_id: cover.shelly_shsw_25_0047f0

@phairplay
just for completeness sake: Ive just updated to 94.3 and no errors are displayed, the device_tracker seems to work as before.
Maybe the configuration checker wasn’t correct after all:-)

update
forget the above, after having updated successfully, and seeing the device_tracker doing its job, I decided to give another restart (had changed several other things) and I get a config error:

18 24

which is rather peculiar, since I also see this:

33
41
now what…?

no, it would simply not create the device_tracker for your phone, all other sensors are in the other components.

I am still amazed this is happening and no one has an answer, doesn’t anybody use the device_tracker at all maybe so no errors are displayed?

there must be a solution somewhere…

If anything, choosing the name huesensor for the custom components was adding to the confusion to say the least. I am now looking for an answer why the device_tracker.huesensor isn’t found…;-|

It simply isn’t a sensor, but a device_tracker.
By separating the components in 3 parts, as was done a few iterations ago, giving a better name would have been possible. The Hue Custom component could have been called hue_custom, (and not huesensor) and create sensor, binary_sensor and device_trackers with that name.

that put aside, it really hope @robmarkcole could shed some light here how to get the device_tracker back on track again in 94.3.

Since I have the config files in a small package, Ive also tried to remove it there and place the device_tracker in device_tracker.yaml, but that makes no difference, same error is thrown.

I’ve now disabled the custom component for the device_tracker, because if not, HA won’t restart, erroring out on the config check, making this a bug of importance…

Sorry for not getting back sooner (I’ve been away)
Why are using it as a device tracker?

I’m currently running 0.94.0

all i have is the below in my sensor yaml file

- platform: huesensor
  ip_address: 192.168.1.1
  token: -mytoken

which means you don’t have the device_tracker, nor the binary_sensors, which do all the magic in HA…

this is exactly what I meant above, naming the component huesensor is confusing.

The component used to create a sensor.telefoon (mobile device with the Hue App) and when the component got split up in 3 parts, it was made a device_tracker, creating a device_tracker.hue_ telefoon (replace telefoon with the name of your device).
If one sets the App to be location sensitive (to create Home and Away routines) a geofence entity is created in the App, which the custom component can read, now as a device_tracker. see: GitHub - robmarkcole/Hue-sensors-HASS: Support for Hue motion sensors and device tracker

It is exactly this part that is not working any longer 94.x upward I guess.

Must confess the device_tracker always shows Home, even on the 84.3 instance I am still running alongside, so not of much use at all I am afraid. That might be a bug too…

whichever it is, I filed an issue just so it doesn’t go under the radar: HA 0.94.3: device_tracker.huesensor not found · Issue #146 · robmarkcole/Hue-sensors-HASS · GitHub with possible clues for the device_tracker issue by @pnbruckner

0.94 broke a lot of things for me, so I’m tempted to move the motion sensors to Deconz too. Just a matter of disconnecting them from the Hue bridge and discovering them with Deconz?

of course I don’t want to interfere with your Deconz travels, but I can confirm 2 of the 3 custom components, sensors and binary_sensors, work without any issue or effort whatsoever, coming from an earlier HA setup. Quite snappy motion sensors triggering what they need to do.

1 Like

@Mariusthvdb
I’m using it capture movement and temp which work completely fine.

I appreciate the feedback! I’m also trying to pair down the number of networks, so that’s not a bad thing. I noticed it was only the device tracker I don’t use anyway that broke from here. My detectors are pretty slow to respond though (on a PI), so I’m curious if Deconz is quicker.

I confess being even more confused now… how can you use the binary_sensors for motion detection, if you don’t have

binary_sensor:
  platform: huesensor

somewhere in your config? Unless you are using an older version of the custom component of course, from before the split-up?
I guess that’s why you have the ip-address also. Which isn’t required anymore in the new component

I see, id be very interested to hear. I did try a Deconz, but returned it because it was impossible to configure, let alone be anywhere near reliable…ymmv of course, as I see many enthusiastic reports. Maybe room space and size is of importance, as is number of detected devices.

when you say you have slow repsonse, are you talking about the new native HA motion sensors, or the CC sensors?

I didn’t realize there were native HA motion sensors, actually. I have three kinds: Xiaomi via Deconz, Smartthings via Smartthings integration, and Hue via Rob’s integration. The Hue ones are a noticable second or two before they trigger, the other ones are quick. I like the Smartthings ones the best as devices because of the magnetic ball mount though.

yes I am using the old version, which works fine therefore I’ve never had a need/want to update it.
sorry if I’ve caused any confusion

np, good to know we can fall-back.
wouldn’t want to miss the added features though :wink:

Yep, I removed them from the Hue App, reset (hole on the back - hold down for about 10 seconds until the light flashes green) and then paired with Deconz

What I did do just before that though was log into the HUE API from a web browser and copy the settings for Light/Dark etc from the JSON to a txt file then put them back in Deconz using the Deconz API

I’m on a Mac and used the PostMan app to log in to the Deconz API

Cheers

mb

1 Like

Thanks! Think I might give that a try myself. Much obliged

1 Like