For some reason I can never get the aqara double switch to actually work with the both press, in the mi home app it registers I press both at the same time, and in the HA interface I see a device for both being pressed at the same time.
Wall Switch (Both)_XXXXXXXX
yet when I use it in automations it never triggers?
- id: 'XXXXXXXXXXX'
alias: XX
trigger:
- event_data:
click_type: single
entity_id: binary_sensor.wall_switch_both_XXXXXXXX
event_type: click
platform: event
This is very strange. I will setup a second gateway and try to reproduce the issue. Could you disable one of your gateways (by configuration) temporary? Does it “fix” the issue?
2017-09-25 09:25:09 ERROR (Thread-3) [PyXiaomiGateway] Got error element in data {“error”:“Invalid key”}
2017-09-25 09:29:47 WARNING (MainThread) [homeassistant.helpers.entity] Update of binary_sensor.motion_sensor_158XXXXXXXXX is taking over 10 seconds
2017-09-25 09:29:47 ERROR (Thread-2) [PyXiaomiGateway] Cannot connect to Gateway
2017-09-25 09:29:47 ERROR (Thread-2) [PyXiaomiGateway] No data in response from hub None
2017-09-25 09:31:00 ERROR (Thread-8) [PyXiaomiGateway] Got error element in data {“error”:“Invalid key”}
2017-09-25 09:31:03 ERROR (Thread-4) [PyXiaomiGateway] Got error element in data {“error”:“Invalid key”}
2017-09-25 09:31:06 ERROR (Thread-8) [PyXiaomiGateway] Got error element in data {“error”:“Invalid key”}
there is some inconsistance as a minute after and before triggering a xiaomi switch with the xiaomi button worked well. Here is my configuration for the xiaomi on configuration.yaml:
# Xiaomi Mi Home Gateway
xiaomi_aqara:
gateways:
- mac: XXXXXXXXXXX6
key: xxxxxxxxxxxxxxw
- mac: XXXXXXXXXXXE
key: xxxxxxxxxxxxxx8
It looks like the motion detector should support light level, but I don’t see that mentioned in this thread. I poked around the home-assistant source and didn’t see it there either.
Another thing you could test: With 0.54 a auto-discovery (netdisco) of the gateway via mDNS was introduced. This mechanism is able to load the xiaomi_aqara component without any line of configuration. However the component won’t be able to control devices because the key is missing. Could you disable “discovery:” or blacklist the xiaomi_aqara component for testing?
Sorry for bothering you again but I noticed that the issue is still present.
The strange thing is that it happens only with a particular sensor which is in a cabinet (which has a window that i also monitor). Do you think is a malfuction or maybe an error?
My issue now seems to have mysteriously fixed itself - not sure why but I am no longer seeing the messages and sensors are now working. I believe that this issue is a side-effect of some other problems that I have been seeing with my installation and everything running very slowly on my pi install.
Hi there very good automation that you did there with gateway can you share you git hub so I can have more ideas from xiaomi stuff i don´t see that much conifg fo xiaomi stuff
I am a homeassistant total noob. I used to have a SmartThings setup but decided to go local and have removed everything.
I have setup my Aqara gateway but do not know where to start with automations.
Can someone please provide some help? A sample config would be even better.
Do I edit the automation.yaml or the configuration.yaml file in order to create automations?
If someone can share some sample code for a simple automation, e.g. if xiaomi door sensor open then play sound from gateway I would be grateful.