Comments (24)
I'm gonna fix this bug this week.
from pyxiaomigateway.
I agree.
I only have one gw and then it works fine.
So the multi gw solution is an old implementation, that I have never tested.
A pull request is welcome :)
from pyxiaomigateway.
You will have this issue even with a single gateway. You just need several XiaomiDevices (like XiaomiMotionSensor) to make a request to gateway at the same time. And there will be a big chance of failure and broken state.
from pyxiaomigateway.
You are right
from pyxiaomigateway.
I have noticed since upgrading to 0.62.1 i am getting a lot of Unavailable status on the window and door sensors, a restart of HA, fixes this for a white while.
from pyxiaomigateway.
@heff27 it can indicate that your local network is not very stable and loses packets sent by gateway.
Can you enable debug logging and provide us xiaomi_gateway
/homeassistant.components.xiaomi_aqara
logs for the last 2 days:
logger:
logs:
xiaomi_gateway: debug
homeassistant.components.xiaomi_aqara: debug
?
Device becomes unavailable when it doesn't send at least one packet of data in 2.5 hours. So if you don't see any report
/read_ack
/write_ack
/heartbeat
from your device in 2.5 hours time frame - you get unavailable
state. Restarting HA just resets this 2.5 hours timer and countdown begins from start :).
from pyxiaomigateway.
Ok i have enabled logging with the command, I am new to logging how do it get the Xiaomi Logs as the home assistant log file, has a load of stuff in it since added the above commands in to my Config Yaml.
Here is one of the errors since logging as enabled
2018-02-03 02:33:24 DEBUG (SyncWorker_0) [xiaomi_gateway] _send_cmd resp << {'cmd': 'write_ack', 'model': 'gateway', 'sid': '34ce008db90c', 'short_id': 0, 'data': '{"rgb":455343891,"illumination":392,"proto_version":"1.0.9"}'}
2018-02-03 02:33:24 ERROR (SyncWorker_0) [xiaomi_gateway] Non matching response. Expecting read_ack, but got write_ack
2018-02-03 02:33:24 DEBUG (SyncWorker_0) [xiaomi_gateway] read_ack << None
2018-02-03 02:33:24 DEBUG (SyncWorker_5) [xiaomi_gateway] _send_cmd resp << {'cmd': 'read_ack', 'model': 'magnet', 'sid': '158d0001a49988', 'short_id': 43824, 'data': '{"voltage":3045,"status":"open"}'}
2018-02-03 02:33:24 ERROR (SyncWorker_5) [xiaomi_gateway] Non matching response. Expecting write_ack, but got read_ack
2018-02-03 02:33:24 ERROR (SyncWorker_0) [xiaomi_gateway] No data in response from hub None
2018-02-03 02:33:24 DEBUG (SyncWorker_5) [xiaomi_gateway] write_ack << None
2018-02-03 02:33:24 ERROR (SyncWorker_5) [xiaomi_gateway] No data in response from hub None
2018-02-03 02:33:24 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]:
from pyxiaomigateway.
@heff27 do it like this:
logger:
default: error
logs:
xiaomi_gateway: debug
homeassistant.components.xiaomi_aqara: debug
This will log only error
logs and all xiaomi-related logs. After 2 days provide us a log file. Read here how you can get all logs as a file: https://home-assistant.io/components/logger/#service-set_level.
from pyxiaomigateway.
HI please attached the log file as requested, if you need anymore information please let me know
Thanks
home-assistant.log.zip
from pyxiaomigateway.
I have greped your log and didn't find any problems during this period. I have checked 4 sids: 158d0001a98550
, 158d0001a98401
, 158d0001d86d4a
and 158d0001d5c426
with the command like this: egrep "homeassistant.components.xiaomi_aqara.*158d0001d5c426" home-assistant.log
.
I see that you have at least 1 PUSH
per hour which means you shouldn't have any unavailabilities. Can you specify at which time did you have unavailability status and for which sids?
from pyxiaomigateway.
158d0001a4c991 7 158d00019e0551 were the sensors that we going into unavailable state but these have seem to have stopped ever since i rebooted after adding the Debug Config.... Sorry probably not what you was looking for..
I am still getting loads of these errors that you can see in the log
No data in response from hub None
23:20 components/binary_sensor/xiaomi_aqara.py (ERROR)
No data in response from hub None
23:20 components/light/xiaomi_aqara.py (ERROR)
Non matching response. Expecting read_ack, but got write_ack
23:20 components/binary_sensor/xiaomi_aqara.py (ERROR)
Non matching response. Expecting write_ack, but got read_ack
23:20 components/light/xiaomi_aqara.py (ERROR)
from pyxiaomigateway.
If you want me to debug unavailability state, you need to provide logs, sids and time when state switch happenned.
I am still getting loads of these errors that you can see in the log
Yes, that's what is explained in this issue and will be fixed. But it's not always connected with unavailability.
from pyxiaomigateway.
I had an unavailability status late Friday night around 11pm i looked in the log and nothing. I looked on the MI apps and the sensor was showing unavailable also.... but yesterday I was back available again with no interaction....
from pyxiaomigateway.
I have same issue with HA component, packet miss/wrong packets(write command other than recieved data)/socket timeouts. It happens often when client (raspberry pi 3 in my case) is connected over wifi network and less often when client is connected over ethernet.
from pyxiaomigateway.
So the multi gw solution is an old implementation, that I have never tested.
I can confirm that with 3 gateways each time I restart HA at least one of the gateways is not found.
Have you or PaulAnnekov started any work on the UDP refactoring? I would like to help.
from pyxiaomigateway.
I have not started on this.
So a pull request would be very welcome
from pyxiaomigateway.
i get the non-matching error too. my gateway seems to have been discovered and responds to the ringtone commands. but no attached devices are discovered.
from pyxiaomigateway.
Having the same issues. errors like:
[xiaomi_gateway] Cannot connect to Gateway
[xiaomi_gateway] No data in response from hub None
Having a about 6 door/window sensors.
With the errors everything seems to working fine, but log is filling
from pyxiaomigateway.
I have been getting the "cannot connect to Gateway" and "No data in response from hub None" since setting up the Xiaomi gear back in Dec last year. The Xiaomi gear works really well 99% of the time but have witnessed automations not turn switches on at the scheduled time only to check the HA logs to see that at the same time the above connection errors had occurred.
Hoping I could solve this by brute force, I changed my network setup so my Aqara gateway is on its own access point in close range and on its own vlan with the home assistant. Network traffic is low.
However since this network topology change I still get the cannot connect and no data in response messages in the logs and have seen switches not turn on when they were supposed to.
I wonder if the ultimate solution is to implement point 4 mentioned by Paul? Suggest that HA checks for the acknowledgment within a timeout period and if not it resends the request?
from pyxiaomigateway.
Hi Paul/Daniel is this ready to test? I can help
from pyxiaomigateway.
@Barrysv yes. It's merged now.
from pyxiaomigateway.
@PaulAnnekov been testing it today - no connection errors in the log and the Xiaomi devices working as expected. Great job
from pyxiaomigateway.
I think this bug was fixed. Closing the issue.
from pyxiaomigateway.
Hi,
Sorry my code skill very bad. So what i need to do in this case. I using newest version of HassIO with docker.
Thanks.
from pyxiaomigateway.
Related Issues (20)
- Support for switch.b2lacn02
- Change Light Migateway to unavailable when migate cannot be reached HOT 4
- Config Flow HOT 4
- Xiaomi Aqara Wireless Releay - HOT 2
- Multicast socket error on WSL system HOT 2
- Support for Aqara wall smart switch D1 (2020 model) HOT 1
- Push the release to pypi please HOT 9
- Pls add support for new type wall switch of Xiaomi HOT 1
- Help With: Zeroconf discovered Gateway could not be located to get the necessary information, try using the IP of the device running HomeAssistant as interface HOT 3
- Aqara Wireless Remote Switch D1 not supported HOT 1
- Unsuported device (Aqara wall switch D1 single rocker with neutral) HOT 1
- Add switch.l3acn3 and switch.n3acn3 support HOT 7
- Endless "Unknown gateway ip" errors in log HOT 1
- i can't use Aqara D1 Wireless Remote Switch (Single Rocker) (WXKG06LM) (lumi.remote.b186acn02) in homeassistant 0.114.3 HOT 7
- Add switch.b2lacn02 support HOT 6
- Unsupported device found! Unsupported device data: dmaker.fan.1c HOT 1
- Support for non-multicast network
- Map models to type collection
- Xiaomi Aqara Wireless Relay HOT 1
- xiaomi_gateway errors dont report which gateway
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyxiaomigateway.