robmarkcole / Hue-sensors-HASS

Support for Hue motion sensors and device tracker
https://home-assistant.io/
343 stars 70 forks source link

Sensors not reporting continuous movement #123

Open aegjoyce opened 5 years ago

aegjoyce commented 5 years ago

I’m having an issue with the motion sensors not tracking correctly. All was working fine with v0.8 on HA 0.88, then I decided to upgrade to HA 0.89. Following this I have started using the latest release of the CC (1.0.4), deleted all the old files and config.yaml entries, and put the new binary_sensor.py in custom_components/huecustom, then set up binary_sensor in config.yaml.

So far, so good - both my motion sensors are picked up by HA and all the correct data is retrieved. However the behaviour of the sensors in HA is now very odd. If I trigger a sensor, it changes from ‘off’ to ‘on’ - however, even if I’m still moving, it then immediately switches back to ‘off’ again. After a short reset time (about 10s or so) it will then respond to movement again - but again will immediately switch back to ‘off’ in spite of persistent movement.

No problems with the sensors themselves which are reporting state correctly to my Hue app.

Is this a known issue with v1.0.4? Any idea about workarounds? May have to downgrade to v0.8 again in the meantime as I have automations based on accurate and timely reporting of motion.

warcanoid commented 5 years ago

I can confirm to have the same problem, please fix this, because I have many automations really on this.

hvbc commented 5 years ago

First of all, thanks for the amazing work! I can also confirm the same problem.

eyeseesharp commented 5 years ago

I made an account just to comment here that I'm having this same problem! Hoping it gets fixed soon

aegjoyce commented 5 years ago

Just wanted to add - reverting to v0.8 fixed this problem for me. Hope this helps people in the meantime.

warcanoid commented 5 years ago

@aegjoyce how???

aegjoyce commented 5 years ago

Remove your existing files and get the 0.8 ones from here: https://github.com/robmarkcole/Hue-sensors-HASS/releases If you’re on HA 0.89 or higher you’ll need to change your customer component file names and folder structure as per instructions on this thread: https://community.home-assistant.io/t/hue-motion-sensors-remotes-custom-component/27176/832

robmarkcole commented 5 years ago

Thanks for reporting this, will look into it next week

warcanoid commented 5 years ago

@robmarkcole thank you! Do not want go back to 0.8

johansmitsnl commented 5 years ago

Same issue here to

warcanoid commented 5 years ago

I noticed that lights will not go on/off on first try. So major problem for automations

claytonjn commented 5 years ago

Strange, I've not seen this behavior. My setup is working as rock-solid as always. I've gone through all HA versions (0.90.1 currently) and all CC versions (1.0.5 currently)

warcanoid commented 5 years ago

@claytonjn lucky you, I have big problems

gensyn commented 5 years ago

Same problem here on HA 0.90.1.

tangrick commented 5 years ago

I am not sure whether this might help those with this problem. I believe it could be due to the hue motion sensor firmware.

Open Hue app, I am using iOS hue app, and check whether there is any firmware update on motion sensor. If there is update them and test it again.

My Philip Hue motion sensor model is SML001 The current latest firmware version I am using is 6.1.1.27575.

They are working fine for me.

Hope this might help.

gensyn commented 5 years ago

I am not sure whether this might help those with this problem. I believe it could be due to the hue motion sensor firmware.

Open Hue app, I am using iOS hue app, and check whether there is any firmware update on motion sensor. If there is update them and test it again.

My Philip Hue motion sensor model is SML001 The current latest firmware version I am using is 6.1.1.27575.

They are working fine for me.

Hope this might help.

I updated to your firmware version but I'm still having the same problem.

warcanoid commented 5 years ago

I have automatic updates in Hue app. The sensor reports motion in Hue app always, but not always in HA! @robmarkcole please fix this!

tangrick commented 5 years ago

I am not sure whether this might help those with this problem. I believe it could be due to the hue motion sensor firmware. Open Hue app, I am using iOS hue app, and check whether there is any firmware update on motion sensor. If there is update them and test it again. My Philip Hue motion sensor model is SML001 The current latest firmware version I am using is 6.1.1.27575. They are working fine for me. Hope this might help.

I updated to your firmware version but I'm still having the same problem.

Not sure why only some have this problem. I did a visual comparison, by having iOS Hue App on iPhone and HA on iPad, I don't have any problem. Both reported the same motion detection. The moment I am in sight of the motion sensor, they both showed motion detected until I stopped moving or move out of sight.

Here are my devices and settings, maybe someone could figure out the reason for this problem

Hue Bridge SW: 19011813309 Motion Sensor SW: 6.1.1.27575. Motion Sensitivity: High

I don't use motion sensor in HA automation, since I mainly using them to control lights. I am using Hue App or iConnectHue App to do all motion sensor setting.

configuration.yaml

hue:
  bridges:
    - host: 10.0.0.102 #seconday
      filename: phue_sec.conf
      allow_unreachable: true
      allow_hue_groups: true
    - host: 10.0.0.103 # main
      filename: phue_main.conf
      allow_unreachable: true
      allow_hue_groups: true

binary_sensor:
  - platform: huesensor

sensor:
  - platform: huesensor

Here are the state attributes I see on HA, check whether you have the same attribute elements. binary_sensor.hallway_motion_sensor | off | light_level: 6758 battery: 100 last_updated: 2019-03-26,05:35:36 lx: 4.74 dark: true daylight: false temperature: 28.01 on: true reachable: true sensitivity: 2 threshold: 23694 friendly_name: Hallway motion Sensor device_class: motion

good luck to those having problem.

warcanoid commented 5 years ago

@tangrick thanks for helping, have all same, only I don’t have filename: phue_main.conf in configuration.yaml.

tangrick commented 5 years ago

@tangrick thanks for helping, have all same, only I don’t have filename: phue_main.conf in configuration.yaml.

It's just contain user authentication to Hue. So I don't think that is the problem {"10.0.0.102": {"username": "uN.....kV"}}

Have you tried deleting huesensor folder in custom_components and re-do huesensor folder again and check to ensure that binary_sensor.py is version = "1.0.5"?

I wonder whether the threshold got anything to do with it. I would try to set motion sensor to max for both motion and light sensitive just to try it out.

And both hue bridge and motion sensor are the same version as mine?

I am asking because I believed, but can't be 100% sure as the motion sensor was configured in Hue app and no automation on HA, so I didn't pay too much attention to it, I think I my motion sensors on HA was exhibiting..something like...it would show "detected" and then almost 2 secs later show "clear" and then many secs..maybe 10secs later with lots of movement..it showed detected again.

But yesterday I opened Hue app, it showed all my motion sensor updating to the new version and then after that HA motion detection and Hue Motion Detection matches.

warcanoid commented 5 years ago

Have all on max in Hue, also do nothing with lights. Have hue sensor 1.0.5 with custom updater.

hvbc commented 5 years ago

I have a possible solution. I did not used my sensors in the Hue app, so the sensor was not configured. Now I configured the sensor in the Hue app (setting a room and selecting "Do nothing") and everything is working as before. :-)

nikolak commented 5 years ago

Is there any update on this issue @robmarkcole ?

The above mentioned fix doesn't work, at least not for me.

johansmitsnl commented 5 years ago

There is now official sensor support in the latest ha release.

See home-assistant/home-assistant#22598

The only missing part are the remotes.

hvbc commented 5 years ago

@Nikola-K I do agree that my solution doesn't work. I switched to the official support, but is is very very slow up to >5 sec. @robmarkcole if this issue is fixable it would be very much appreciated!

nikolak commented 5 years ago

Also worth linking to the updates interval issue in the official integration - https://github.com/home-assistant/home-assistant/issues/23502

Although the developer seems to be very reluctant to make it configurable, it can be manually adjusted - depending on the setup, how often you update, etc doing that is either more or less work.

Personally for me it was too much work to maintain that and it doesn't support switches so I moved to deCONZ to improve the integration and allow multiple different devices, and it works great. That solution of course however costs and requires additional hardware.

robmarkcole commented 5 years ago

I cant reproduce this issue

aegjoyce commented 5 years ago

Nor can I anymore!

I had been running 1.2 as was getting the expected behaviour from it, then deleted the CC altogether with the release of the official integration. Unhappy with the delay in sensor response, I've just reinstalled 1.4, which works perfectly.

Happy to close this issue

aegjoyce commented 5 years ago

...hang on.

Having just tested this, I've found that the problem is only occurring with ONE of my two Hue motion sensors. My upstairs one is fine; the downstairs one isn't. The problem is only with the custom component - comparing it simultaneously with the official component, the official one tracks constant motion, whilst the custom component doesn't. Both official and custom sensors work fine with the upstairs sensor.

Weird!

aegjoyce commented 5 years ago

FIXED IT!

Tried a few things like re-linking and renaming the sensor but still didn't work. Then - took the batteries out, gave it about a minute, then put them back in. Boom! All working as it should :)

aegjoyce commented 5 years ago

Nope. Stopped working again. God knows what's wrong with it.

Camatobe commented 4 years ago

It's an aparently old issue, but I am having the same problem. I am on HA 0.103.4 right now with v2.2 of your component.

Continuous movement is not very well detected. I was making a workaround with an template sensor. (it checks the official motion sensor and the one of your integration, if any of it is on, the template sensor is on)

I like using your sensor to trigger my lights, because it's much faster than the official integration.

The error? Don't know where it is coming from. Logs dont say a word, I think it is happening, when I did not restarted my hassio a long time, but maybe this is a placebo.

johansmitsnl commented 4 years ago

https://github.com/johansmitsnl/home-assistant home-assistant contains a dev branch with the possibility to change the refresh time of the sensor. Motion sensor only and not remotes.

it never got accepted you can read it here https://github.com/home-assistant/home-assistant/pull/24147 but it does work and i rebase the branch frequently because i use it in my home.