Coder Social home page Coder Social logo

wernerhp / ha.appdaemon.aqara_motion_sensors Goto Github PK

View Code? Open in Web Editor NEW
39.0 8.0 5.0 10 KB

An AppDaemon app to reset Xiaomi Aqara motion sensors after a given timeout.

License: MIT License

Python 100.00%
home-automation home-assistant homeassistant hacs appdaemon appdaemon-apps

ha.appdaemon.aqara_motion_sensors's People

Contributors

abacao avatar wernerhp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha.appdaemon.aqara_motion_sensors's Issues

Hack aqara with ZHA integration

Greetings,

I have aqara sensor with ZHA integration but appdaemon_aqara_motion_sensors not resat my sensor to 5 second.
I have config in app.yaml with appdaemon 4.

Suggestion about making the code more global for working with ZHA, too

Hi,

your appdaemon script doesn't work with ZHA, only the aqara integration.

But if you change:

    for entity_id in motion_sensors:
#     self.listen_event(self.motion_sensor_state_on, "xiaomi_aqara.motion", entity_id=entity_id)
      self.listen_state(self.motion_sensor_state_on, entity_id, new = "on")

# def motion_sensor_state_on(self, event, data, kwargs):    
  def motion_sensor_state_on(self, entity, attribute, old, new, kwargs):
    """Set motion sensor state to on"""
    entity_id = entity

it should probably work globally.
I can say that this works with ZHA, could you please test it with the aqara integration. If it works, too, you could think about changing those three lines in your code...

Seb

State not Changing

I'm currently using this addon to test the Aqara sensor before doing the hardware fix. Correct me if I'm wrong, but what the addon should do is change the state on the Binary Sensor from DETECTED to CLEAR after 5 seconds, correct?

When I go into AppDaemon I see:

Name | State | Callbacks (instance) | Callbacks (AD Lifetime) | Arguments
aqara | idle | 0 | 0 | {"module":"aqara","class":"Aqara","timeo...

The state just stays idle. I'm wondering if this signifies that there is something currently wrong?

My apps.yaml looks like this:

aqara:
module: aqara
class: Aqara
timeout: 5
motion_sensors:
- binary_sensor.lumi_lumi_sensor_motion_aq2_7e554b05_ias_zone

Issue with occupancy state

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!

Trouble renaming module to work alongisde ControllerX

I'm going to apologise in advance for this, because I feel like I must be missing something obvious - but I can't figure it out :-/

I'm trying to setup this module. I already use ControllerX, so I need to rename it (as per install guide and #11) to avoid module naming conflicts.

I've tried every combination of:

  • Renaming /config/appdaemon/apps/ha.appdaemon.aqara_motion_sensors/aqara.py to /config/appdaemon/apps/ha.appdaemon.aqara_motion_sensors/aqaramotion.py
  • Changing "MODULE = 'aqara'" to "MODULE = 'aqaramotion'" in aqara.py
  • Changing the name of the apps.yaml entry from "aqara:" to "aqaramotion:"
  • Changing "module: aqara" to "module: aqaramotion" in apps.yaml

And I'm still getting "WARNING AppDaemon: Unable to find module aqaramotion - initialize() skipped" errors in the AppDaemon log.

Current config looks like:

aqaramotion:
  module: aqaramotion
  class: Aqara
  timeout: 5
  motion_sensors:
    - binary_sensor.some_sensor_i_have

With aqara.py renamed to aqaramotion.py and "MODULE = 'aqara'" changed to "MODULE = 'aqaramotion'" in its contents.

Suggestions? And thanks.

Aqara module name conflict with ControllerX

When using ControllerX together with Appdaemon Aqara Motion Sensors there will be a module name conflict. ControllerX has also a module named 'aqara' and a file names aqara.py. Both apps won't work when you try to use them together. I solved this by renaming this module to aqara2. Then it works again. Maybe the source code should use a different name so this won't occur, like 'aqaramotion'.

Unable to use it on the latest HACS

This is the message I'm getting when trying to install the repo manually.

Repostitory structure for v1.0.1 is not compliant

also I wasn't able to find this integration on the default HACS integrations.

Как настроить? \ How to configure it?

К сожалению нет подробной инструкции как это настраивается и я не смог настроить. Пришлось спрашивать у знающих. Делюсь своим опытом, это может помочь вам. Сперва нужно убедиться, что у вас стоит аддон AppDaemon 4. Если не стоит, то ставим его.

AppDaemon 4

После установки аддона AppDaemon 4 должна появиться папка appdaemon.
appdaemon01

Внутри этой папки должны быть подпапки, если этих подпапок нет, значит что-то пошло не так, тогда нужно сделать следующее:

  1. Если стоит аддон AppDaemon 4, то удаляем этот аддон AppDaemon 4
  2. Удаляем папку appdaemon
  3. Перезагружаем Home Assistant
  4. Ставим аддон AppDaemon 4 по новой
  5. Должна появиться папка appdaemon и подпапки

Вот так должно быть в папке appdaemon
appdaemon02

Далее заходим в папку apps и открываем файлик apps.yaml
apps

В этом файлике прописываем настройки для датчиков. Указываем время сброса статуса

Вот мой пример. Я решил разделить все датчики и не смешивать в одну кучу. Вы конечно можете смешать все в одну кучу как показал автор.
konfig


Unfortunately, there is no detailed instructions on how to configure this and I was not able to configure it. I had to ask the knowledgeable ones. I share my experience, it can help you. First you need to make sure that you have the addon Ap Daemon 4. If not, then put it.

AppDaemon 4

After installing the Ap Daemon 4 addon, the app daemon folder should appear.

appdaemon01

There should be subfolders inside this folder, if there are no subfolders, then something went wrong, then you need to do the following:

  1. If there is an addon Ap Daemon 4, then remove this addon Ap Daemon 4
  2. Deleting the app daemon folder
  3. Restart the Home Assistant
  4. We put the appdaemon 4 addon on a new one
  5. The app daemon folder and subfolders should appear

This is how it should be in the app daemon folder
appdaemon02

Next, go to the apps folder and open the app.yaml file
apps

In this file, we specify the settings for the sensors. Specify the time to reset the status
Here is my example. I decided to separate all the sensors and not mix them in one pile. You can certainly mix everything into one pile as the author showed.
konfig

Problem Version 1.2.0

The addon version 1.2.0 don't work not reset sensors to 5 second. :

  • AppDaemon 4 version: 0.7.1
  • HASSIO : core-2021.12.0 supervisor-2021.12.1

It works with old version 1.0.1, do you know where the problem may be coming from ?

Thanks

Resetting Aquara Motion Sensors integrated through zigbee2mqtt

As per the title I have dismissed the homeassistant xiaomi platform in favour of zigbee2mqtt.
Not really an issue but rather a request for improvment.
I read the code and I see it is based on that component.
My question / request is : would it be possible to extend the automation also to aquara through 2zmqtt ?
TX

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.