wernerhp / ha.appdaemon.aqara_motion_sensors

An AppDaemon app to reset Xiaomi Aqara motion sensors after a given timeout.
MIT License
40 stars 5 forks source link

Issue with occupancy state #14

Open tthlacus opened 1 year ago

tthlacus commented 1 year ago

It looks like after an update (unfortunately I have no idea when) the sensor is not turning back to "clear" status after the given time, however, there is a refreshment every 5 seconds (can see it in the lux values) so partly it is working. (HACS 1.29.1; AppDaemon 0.11.0) I tried restarting it, removing and adding again, but none of those helped. Is there any idea what can I try to make it work again? Thanks!

shummo commented 1 month ago

I have problem too with the occupancy state. There is the log in the appdaemon:

2024-05-16 13:47:09.011716 INFO AppDaemon: Loading App Module: /config/apps/appdaemon_aqara_motion_sensors/aqara.py
2024-05-16 13:47:09.030116 INFO AppDaemon: Loading app aqara using class Aqara from module aqara
2024-05-16 13:47:09.030986 INFO AppDaemon: Calling initialize() for aqara
2024-05-16 13:47:09.035602 WARNING aqara: aqara: Entity . not found in namespace default
2024-05-16 13:47:09.050808 INFO AppDaemon: App initialization complete
2024-05-16 13:48:05.754690 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:48:07.047005 WARNING HASS: Error getting services - retrying
Task exception was never retrieved
future: <Task finished name='Task-93' coro=<HassPlugin.run_hass_service_check() done, defined at /usr/lib/python3.11/site-packages/appdaemon/plugins/hass/hassplugin.py:763> exception=ClientResponseError(RequestInfo(url=URL('http://supervisor/core/api/services'), method='GET', headers=<CIMultiDictProxy('Host': 'supervisor', 'x-ha-access': '8fb93c02e2e57207070bdd57bd5febca06837c9f3f1c49582716b4eb1cdc9d7cd0773da8724c6425c915ceccc92a5a2046497bd543edcfff', 'Accept': '*/*', 'Accept-Encoding': 'gzip, deflate', 'User-Agent': 'Python/3.11 aiohttp/3.8.6')>, real_url=URL('http://supervisor/core/api/services')), (), status=502, message='Bad Gateway', headers=<CIMultiDictProxy('Content-Type': 'text/plain; charset=utf-8', 'Content-Length': '16', 'Date': 'Thu, 16 May 2024 11:48:07 GMT', 'Server': 'Python/3.12 aiohttp/3.9.5')>)>
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/appdaemon/plugins/hass/hassplugin.py", line 772, in run_hass_service_check
    hass_services = await self.get_hass_services()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/plugins/hass/hassplugin.py", line 732, in get_hass_services
    r.raise_for_status()
  File "/usr/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1011, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('http://supervisor/core/api/services')
2024-05-16 13:48:10.758357 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:48:15.762089 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:48:20.765386 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:48:25.810649 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:48:36.634301 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:48:41.639217 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:48:46.645459 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:48:51.650545 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:48:56.655944 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:49:01.661310 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:49:06.666842 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:49:11.671582 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds
2024-05-16 13:49:16.677827 INFO HASS: Connected to Home Assistant 2024.5.3
2024-05-16 13:49:16.701225 INFO HASS: Evaluating startup conditions
2024-05-16 13:49:16.704956 INFO HASS: Startup condition met: hass state=RUNNING
2024-05-16 13:49:16.705065 INFO HASS: All startup conditions met
2024-05-16 13:49:16.725926 INFO AppDaemon: Processing restart for HASS
2024-05-16 13:49:16.726102 INFO AppDaemon: Terminating aqara
2024-05-16 13:49:16.727717 INFO AppDaemon: Reloading Module: /config/apps/appdaemon_aqara_motion_sensors/aqara.py
2024-05-16 13:49:16.728509 INFO AppDaemon: Loading app aqara using class Aqara from module aqara
2024-05-16 13:49:16.729178 INFO AppDaemon: Calling initialize() for aqara
2024-05-16 13:49:16.732568 INFO aqara: Previous message repeated 1 times
2024-05-16 13:49:16.732673 WARNING aqara: aqara: Entity . not found in namespace default