Hue motion sensors + remotes: custom component

I have the exact same problem when motion sensors are set as binary_sensors in the newest version. So the problem is not the sensitivity, there is a bug in either in CC or HA. It works flawlessly in 1.0.2 but not in 1.0.4.

made that. small Tiles setup, with rather a complicated Hue logic behind it…

not sure about that. I have 2 setups both with version 1.04. ha84.3 and ha90.2. Both work as expected.

if you are on the latest HA version, are you sure you have setup the new custom component folder and naming correctly (Great Migration)?

I do notice that the angle and coverage of the Hue sensor can be a bit precise: one of my sensors is on a shelf in the Auditorium (see screenshot), looking out over my couch. If I wave my arm, it won’t always detect, but when I stand up, it immediately responds. Its on for about 10 seconds and then returns to its Off state. If I then standup again, it immediately detects.

23

I am on the latest HA and I did setup the 1.0.4 according to the guides here. They worked fine and no errors in HA logs. But many times during the day the lights would go off even if there is movement and they will not turn on until I leave bathroom and return to it.

This is not happening at all when on 1.0.2, the lights stay on always when someone is in the bathroom. Testing period have been around 3-4 weeks with exactly the same automation and HA version.

But since there is no errors or nothing, it is really hard to pinpoint the exact failure point.

Also I have tested multiple HA versions but they have no effect on this.

if the essential issue is an update from 1.0.2 to 1.0.4 for the CC Hue, you could check the difference on the GitHub, and see if that would give you some pointers to a solution, or at least the cause…
As said, I don’t experience what you describe, so it might be difficult to point it to a general issue…

1 Like

What can be wrong when I see my motion sensor but none of my dimmer or tap-switches?

Did you add both binary_sensor.py and sensor.py?

Yes I did.

Release 1.2 adds support for Friends of Hue switches, thanks to @claytonjn I am keen to know of anyone who has a FOH switch, particularly it they are in the UK. Thanks!

I am getting this error logged every second:

2019-04-09 10:54:36 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/huesensor/sensor.py", line 190, in update_bridge
for sensor in bridge.api.sensors.values()
  File "/config/custom_components/huesensor/sensor.py", line 59, in parse_hue_api_response
data_dict[_key] = parse_zgp(sensor)
  File "/config/custom_components/huesensor/sensor.py", line 75, in parse_zgp
button = TAP_BUTTONS[press]
KeyError: 0

It is happening from this morning, I have also updated huesensors to the latest release.

Hi Rob,

Looks like you forgot to change the version number. Custom updater still “thinks” I’m on 1.0.5.

DEPENDENCIES = ["hue"]

__version__ = "1.0.5"

Cheers,

Michel

Looks like you have Hue Taps and one of them is reporting a buttonevent 0, which is not expected. The error should go away if you press any button on whichever Tap it is, but maybe line 73 of sensor.py should be changed to something like:

if press is None or press is not in TAP_BUTTONS:

Ok, I had an hue tap switch in a cabinet that I never used during the last year. Clicking a button on it fixed the issue.

I have tons of these entries in my log as well today, but it stopped after I pushed a button on the tap device. Obviously something is not right though, and I have never seen this error before.

My best guess would be that there was a bridge update or something else causing the taps to report the unexpected state until pressed. Literally nothing has changed with that code since January 2018.

I’m getting similar I think just so you know your not alone. I have a motion sensor in the bathroom which turns on, and turns off a Wemo wall switch after a period of no motion. Occasionally with a prolonged stay of probably repeated motions that keep the light on (trimming the beard lol) the light will go off anyways and not come on with any amount of hand waving. I’ll recheck my error log but I believe there is nothing there (like when u some times can’t poll the hue bridge). I also don’t remember having this issue a few iterations ago.
This is a great custom component but can anyone explain how the hue motion sensor interacts directly with a hue light that makes that set up react instantaneously?
Would there be any advantage to using the emulated hue bridge option in HA (I’ve always had the physical hue bridge)
It seems like the custom component polls the bridge as quickly as possible so

Motion sensor on > physical bridge <> HA(polling) > light switch on. (fast)

Vs

Motion sensor > HA emulated bridge on good spec system > light switch on. (Faster??)

Vs all Hue environment, physical bridge and light

Motion detector > light on (Fastest)

I could be wrong about the environments. Appreciate any enlightenment

Anyone running 0.91.3 - Not sure if this has now been broken? I see this in the log and no longer see my motion sensors:

File "/config/custom_components/huesensor/binary_sensor.py", line 7
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

You shouldn’t have any html in the binary_sensor.py file, something got copied wrong.

You need to download the raw file: https://raw.githubusercontent.com/robmarkcole/Hue-sensors-HASS/master/custom_components/huesensor/binary_sensor.py

You can click the Raw button in github to generate a link for that file.

So this pull request finally got approved, will this effectively do away with this custom component?