Hue motion sensors + remotes: custom component

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

Hi, when i upload the “huesensor” folder from https://github.com/robmarkcole/Hue-sensors-HASS into my “custom_components” folder and insert in configuration.yaml

sensor:
  - platform: huesensor
binary_sensor:
  - platform: huesensor

i get the error

Integration huesensor not found when trying to verify its binary_sensor platform.
Integration huesensor not found when trying to verify its sensor platform.

How can i fix this? I’m using hass.io 0.94.4. With the standard hue integration in home assistant, i only get the ligts and the rooms, but not my two hue remote.

Did you restart home assistant so that it could pickup the new folder/file?