Xiaomi Human / Body / Motion Sensor - Timeout

thank you for the solution, but I’m getting the following error. the hassapi module, is it something that is exclusive to hassio\supervisor? I’m running HA as docker without supervisor component,

2020-08-25 22:16:55 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.aqara. Make sure all dependencies are installed
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/loader.py”, line 436, in _load_file
module = importlib.import_module(path)
File “/usr/local/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 783, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/config/custom_components/aqara.py”, line 3, in
import hassapi as hass
ModuleNotFoundError: No module named 'hassapi’
2020-08-25 22:16:56 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.aqara. Make sure all dependencies are installed
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/loader.py”, line 436, in _load_file
module = importlib.import_module(path)
File “/usr/local/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 783, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/config/custom_components/aqara.py”, line 3, in
import hassapi as hass
ModuleNotFoundError: No module named 'hassapi’
2020-08-25 22:16:56 ERROR (MainThread) [homeassistant.setup] Setup failed for aqara: Integration not found.

This is an AppDaemon app that is available in HACS. It is not a HA integration or custom component and can not be loaded as such.

See https://hacs.xyz/ and https://appdaemon.readthedocs.io/en/latest/INSTALL.html to install AppDaemon. Then you can install this app from the HA Community Store.

1 Like

Looking to buy some of these and do the hardware mod. Do they work with HA 0.114.4 and ZHA?

I plan on just doing a Node-Red flow to set the state of the sensor from on to off in order to allow the sensor to update the state again after 5 seconds.

Yes, they do. I’m using ZHA with a RaspBee II ZigBee shield: No issues

1 Like

Hi All,

I have set up Appdaemon 4 and set up appdaemon_aqara_motion_sensors integration.
Working with ZHA and tasmotized Sonoff ZigBee bridge.
Sensor is till on for 2 minutes.
Anyone having this working?
Am I missing something?

Thanks.

so there’s no way to fix the initial python script?

@syssi Is there going to be an update on this. I am still on 0.111 just for this.

Hi all,

what is the best way to reset the value to occupancy = no with hassio and node red? i dont find a good solution for me, can you give me a description of the solution?

Thank you

best regards

Mathias

do I have to insert the sd card to my pc to do this ? I have the sd card to my rpi3 and used file editor to find this folder but i couldnt find it

I don’t think you’ll be able to do this from the SD card. How did you install Home Assistant? Are you using HassIO?

I am using raspberry pi and with etcher i installed home assistant. but i dont understand where or how to find binary_seneor/xiaomi.py

@Ody - It certainly sounds like you’re using HassIO/HassOS/Home Assistant OS or maybe it’s just called “Home Assistant” nowadays (too many names for the same thing :frowning:). Unfortunately I’ve never used that particular installation method myself and so I’m not sure how you’d go about accessing the application files.

This said, this page might help you: https://www.home-assistant.io/hassio/haos_common_tasks/

Failing that, hopefully someone else that reads this can help.

1 Like

Hello everyone,

I have read the different solutions proposed, but if I understand correctly none is stable until now.

Am I right ? Or can I try one of the proposed solutions?

Thx

does this work (newest update of HA) 2020_12_1

Yes it does
To be clear this is all that I’m doing.
1- Hardware modification
2- Automation script

which automation script are you referring to?

1 Like

Yep it still works perfectly for me. The sensors are much faster at clearing after being triggered

which automation script are you referring to?

alias: 'Xiaomi Aqara Motion Sensors duration fix'
trigger:
  - platform: homeassistant
    event: start
action:
  - service: deconz.configure
    data:
      entity: binary_sensor.aqara_motion1
      field: "/config"
      data: {"duration": 5}
  - service: deconz.configure
    data:
      entity: binary_sensor.aqara_motion2
      field: "/config"
      data: {"duration": 5}
2 Likes

HW mode and the above automation script works for all my aqara motion sensors.
(Latest HA on Raspberry 3B. Conbee II latest FW)
Unfortunately light sensor seems to update only when motion is triggered. Adding sensor.lightlevel to the script doesn’t help.
What is your experience with light sensor? Any solution to get light level more frequently ?

Sorry, I don’t bother using light sensor, I don’t have a need, but if anyone knows, I’d love to know in case in the future I find a need.