Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xiaomi gateway disappearing and builtin light/sensor updates #21116

Closed
wants to merge 6 commits into from
Closed

Conversation

stsergo
Copy link

@stsergo stsergo commented Feb 16, 2019

Description:

Related issue (if applicable): fixes #20329 #20383

This fix addresses next issues:

  • Gateway disappearing after 2.5 hours of HA uptime
  • Built-in illumination sensor updates only once (at restart of HA)
  • Built-in light switch works incorrectly

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

stsergo and others added 5 commits February 16, 2019 12:25
Enable polling of xiaomi gateways devices
Fix for Illumination sensor of gateway get values only once (after restart of HA)
Fix for light switch won't report states back to HA
@homeassistant
Copy link
Contributor

Hi @stsergo,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@andriej
Copy link
Contributor

andriej commented Feb 17, 2019

Can confirm code working with setup of 3 gateways.

@zatarra77
Copy link

Sorry for the noob question, I'd like to test it but how can I apply this fix in hassio? SSH or simply activating the beta repository?

Thank you

"""Return the polling state. No polling needed."""
return False
"""Return the polling state."""
return True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we should return True here, we should remove the property completely, since True is the default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'd removed these lines

@syssi
Copy link
Member

syssi commented Feb 18, 2019

At the moment the component parses a multicast message (gw ip -> 224.0.0.50:9898). We could call it "local push". This code change implements polling. It requests the current state of a sensor periodically (via udp). The gateway responds with a unicast message (gw ip -> home assistant ip). For bad networks with broken multicast support this will help somehow. I'm unsure if it's a good change or not. ;-)

@stsergo
Copy link
Author

stsergo commented Feb 18, 2019

At the moment the component parses a multicast message (gw ip -> 224.0.0.50:9898). We could call it "local push". This code change implements polling. It requests the current state of a sensor periodically (via udp). The gateway responds with a unicast message (gw ip -> home assistant ip). For bad networks with broken multicast support this will help somehow. I'm unsure if it's a good change or not. ;-)

My gateway sends only ip in heartbeat messages.
So there is no way to get sensors state without request it.

Example:

U 192.168.2.204:4321 -> 224.0.0.50:9898 #12
  {"cmd":"heartbeat","model":"gateway","sid":"04cf8c91566f","short_id":"0","token":"KknlKETfDUbAQEUa","data":"{\"ip\":\"192.168.2.204\"}"}
#
U 192.168.2.107:48879 -> 192.168.2.204:9898 #13
  { "cmd":"read","sid":"4cf8c91566f"}
#
U 192.168.2.204:9898 -> 192.168.2.107:48879 #14
  {"cmd":"read_ack","model":"gateway","sid":"4cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":708,\"proto_version\":\"1.1.2\"}"}```

Remove should_poll property due to True is default
@Danielhiversen
Copy link
Member

I am not sure if this is a good idea.
It should at least be configurable, and not the default behavior.

@syssi
Copy link
Member

syssi commented Feb 18, 2019

My gateway sends only ip in heartbeat messages.
So there is no way to get sensors state without request it.

Which hardware version of the gateway do you own? It looks like a lumi.v3 with LAN protocol version 1.1.2. I assume there is something wrong with your network. Your log should look like this (without any requests):

2019-01-05 21:32:44 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'motion', 'sid': '158d0001aea71a', 'cmd': 'report', 'data': '{"no_motion":"180"}', 'short_id': 9483}
2019-01-05 21:32:44 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Motion Sensor_158d0001aea71a: off>: {'no_motion': '180'}
2019-01-05 21:33:02 DEBUG (Thread-23) [xiaomi_gateway] MCAST (heartbeat) << {'model': 'magnet', 'sid': '158d0001876595', 'cmd': 'heartbeat', 'data': '{"voltage":3025,"status":"close"}', 'short_id': 1591}
2019-01-05 21:33:02 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Door Window Sensor_158d0001876595: off>: {'voltage': 3025, 'status': 'close'}
2019-01-05 21:34:23 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'weather.v1', 'sid': '158d0001f53706', 'cmd': 'report', 'data': '{"temperature":"1957"}', 'short_id': 18366}
2019-01-05 21:34:23 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'weather.v1', 'sid': '158d0001f53706', 'cmd': 'report', 'data': '{"humidity":"5296"}', 'short_id': 18366}
2019-01-05 21:34:23 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Pressure_158d0001f53706: 1008.3>: {'temperature': '1957'}
2019-01-05 21:34:23 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'weather.v1', 'sid': '158d0001f53706', 'cmd': 'report', 'data': '{"pressure":"100856"}', 'short_id': 18366}
2019-01-05 21:34:23 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Humidity_158d0001f53706: 52.7>: {'temperature': '1957'}
2019-01-05 21:34:23 DEBUG (Thread-23) [xiaomi_gateway] MCAST (heartbeat) << {'model': 'weather.v1', 'sid': '158d0001f53706', 'cmd': 'heartbeat', 'data': '{"voltage":2985,"temperature":"1957","humidity":"5296","pressure":"100856"}', 'short_id': 18366}
2019-01-05 21:34:23 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Temperature_158d0001f53706: 19.6>: {'temperature': '1957'}
2019-01-05 21:34:23 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Pressure_158d0001f53706: 1008.3>: {'humidity': '5296'}
2019-01-05 21:34:23 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Pressure_158d0001f53706: 1008.3>: {'pressure': '100856'}
2019-01-05 21:34:23 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Humidity_158d0001f53706: 52.7>: {'pressure': '100856'}
2019-01-05 21:34:23 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Temperature_158d0001f53706: 19.6>: {'pressure': '100856'}
2019-01-05 21:34:23 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Pressure_158d0001f53706: 1008.6>: {'pressure': '100856', 'temperature': '1957', 'voltage': 2985, 'humidity': '5296'}

@stsergo
Copy link
Author

stsergo commented Feb 18, 2019

My gateway sends only ip in heartbeat messages.
So there is no way to get sensors state without request it.

Which hardware version of the gateway do you own? It looks like a lumi.v3 with LAN protocol version 1.1.2. I assume there is something wrong with your network. Your log should look like this (without any requests):

2019-01-05 21:32:44 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'motion', 'sid': '158d0001aea71a', 'cmd': 'report', 'data': '{"no_motion":"180"}', 'short_id': 9483}

You are right - lumi.v3 with LAN protocol version 1.1.2
For now my setup is only gateway without any sensors connected to it.

Network setup simple as possible: Apple time capsule as wifi and router. HA at lan, gateway on wifi. No VLANS, no segments.

Due to apple bonjour works as expected I consider that there is no issues with multicast. I also check multicast connectivity by omping tool from my 2 laptops to HA and there is no issues also.

My gateway send nothing about built-in sensors until we ask :(
Connected sensors work OK, as I can see from community discussions.

I think it would be a good idea to enable polling only for built-in sensors.

@syssi
Copy link
Member

syssi commented Feb 19, 2019

@stsergo This is the multicast message of the gateway. It publishs the state of the light and illumination sensor every 60 seconds:

2019-01-05 18:38:03 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'gateway', 'sid': '34ce0088db0b', 'cmd': 'report', 'data': '{"rgb":0,"illumination":371}', 'short_id': 0}
2019-01-05 18:38:03 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Illumination_34ce0088db0b: 273.0>: {'illumination': 371, 'rgb': 0}
2019-01-05 18:38:03 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Gateway Light_34ce0088db0b: off>: {'illumination': 371, 'rgb': 0}
2019-01-05 19:37:55 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'gateway', 'sid': '34ce0088db0b', 'cmd': 'report', 'data': '{"rgb":0,"illumination":371}', 'short_id': 0}
2019-01-05 19:37:55 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Illumination_34ce0088db0b: 71.0>: {'illumination': 371, 'rgb': 0}
2019-01-05 19:37:55 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Gateway Light_34ce0088db0b: off>: {'illumination': 371, 'rgb': 0}
2019-01-05 20:37:48 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'gateway', 'sid': '34ce0088db0b', 'cmd': 'report', 'data': '{"rgb":0,"illumination":372}', 'short_id': 0}
2019-01-05 20:37:48 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Illumination_34ce0088db0b: 71.0>: {'illumination': 372, 'rgb': 0}
2019-01-05 20:37:48 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Gateway Light_34ce0088db0b: off>: {'illumination': 372, 'rgb': 0

I mixed things up: The message is called report.

@stsergo
Copy link
Author

stsergo commented Feb 19, 2019

@stsergo This is the multicast message of the gateway. It publishs the state of the light and illumination sensor every 60 seconds:

2019-01-05 18:38:03 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'gateway', 'sid': '34ce0088db0b', 'cmd': 'report', 'data': '{"rgb":0,"illumination":371}', 'short_id': 0}
2019-01-05 18:38:03 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Illumination_34ce0088db0b: 273.0>: {'illumination': 371, 'rgb': 0}
2019-01-05 18:38:03 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Gateway Light_34ce0088db0b: off>: {'illumination': 371, 'rgb': 0}
2019-01-05 19:37:55 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'gateway', 'sid': '34ce0088db0b', 'cmd': 'report', 'data': '{"rgb":0,"illumination":371}', 'short_id': 0}
2019-01-05 19:37:55 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Illumination_34ce0088db0b: 71.0>: {'illumination': 371, 'rgb': 0}
2019-01-05 19:37:55 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Gateway Light_34ce0088db0b: off>: {'illumination': 371, 'rgb': 0}
2019-01-05 20:37:48 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'gateway', 'sid': '34ce0088db0b', 'cmd': 'report', 'data': '{"rgb":0,"illumination":372}', 'short_id': 0}
2019-01-05 20:37:48 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Illumination_34ce0088db0b: 71.0>: {'illumination': 372, 'rgb': 0}
2019-01-05 20:37:48 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Gateway Light_34ce0088db0b: off>: {'illumination': 372, 'rgb': 0

Mine sent only ip :(
What version of firmware do you have? I have 1.4.1_164.0158 out of box.
And how this traffic looks in ngrep?

@andriej
Copy link
Contributor

andriej commented Feb 19, 2019

@stsergo This is the multicast message of the gateway. It publishs the state of the light and illumination sensor every 60 seconds:

2019-01-05 20:37:48 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'gateway', 'sid': '34ce0088db0b', 'cmd': 'report', 'data': '{"rgb":0,"illumination":372}', 'short_id': 0}

I mixed things up: The message is called report.

Is it possible that some firmwares don't send that message and still it's working in HA? I don't see that in log, maybe I don't have enough debugging turned on? Should I see it in meanwhile of normal traffic?

EDIT:
ngrep port 9898 show heartbeat's from gw.

@syssi
Copy link
Member

syssi commented Feb 19, 2019

Got it! It's a firmware issue. Firmware version 1.4.1_164.0158 doesn't publish the report message of the gateway anymore. There are some report message but the one of the gateway is missing:

#
U 192.168.130.29:4321 -> 224.0.0.50:9898
  {"cmd":"report","model":"motion","sid":"158d000119fd8c","short_id":56278,"data":"{\"no_motion\":\"300\"}"}                                                                                                                                
#
U 192.168.130.29:4321 -> 224.0.0.50:9898
  {"cmd":"report","model":"sensor_motion.aq2","sid":"158d00016dc0d8","short_id":14573,"data":"{\"lux\":\"122\"}"}                                                                                                                           
#
U 192.168.130.29:4321 -> 224.0.0.50:9898
  {"cmd":"report","model":"sensor_motion.aq2","sid":"158d00016dc0d8","short_id":14573,"data":"{\"status\":\"motion\"}"}                                                                                                                     
#

In this case polling is a workaround.

@andriej
Copy link
Contributor

andriej commented Feb 19, 2019

I'm running latest (at least as of yesterday):

#                                                                                                                                                                                                                  
U 192.168.x.x2:4321 -> 224.0.0.50:9898                                                                                                                                                                             
  {"cmd":"heartbeat","model":"gateway","sid":"7811dcdad7a3","short_id":"0","token":"hoFklTtWx9Pxxx","data":"{\"ip\":\"192.168.x.x2\"}"}                                                                          
#                                                                                                                                                                                                                  
U 192.168.x.x0:4321 -> 224.0.0.50:9898                                                                                                                                                                             
  {"cmd":"heartbeat","model":"gateway","sid":"34ce008c0674","short_id":"0","token":"7ABTqZJM6tsxxx","data":"{\"ip\":\"192.168.x.x0\"}"}                                                                          
#                                                                                                                                                                                                                  
U 192.168.x.x1:4321 -> 224.0.0.50:9898                                                                                                                                                                             
  {"cmd":"heartbeat","model":"gateway","sid":"34ce008c136a","short_id":"0","token":"VikVbxsquqf2xxx","data":"{\"ip\":\"192.168.x.x1\"}"}                                                                          
#                                                                                                                                               

Those are the heartbeats, right?
GW itself identifies as lumi.v3 but some time ago it was lumi v2 (?) and protocol in APP changed from LAN to WiFi (mihome).

@syssi
Copy link
Member

syssi commented Feb 19, 2019

@andriej This is the message we are looking for:

# 'cmd': 'report'
{'model': 'gateway', 'sid': '34ce0088db0b', 'cmd': 'report', 'data': '{"rgb":0,"illumination":573}', 'short_id': 0}

You've posted the heartbeat used for key rotation. I've mixed these two messages types up in the past.

@andriej
Copy link
Contributor

andriej commented Feb 19, 2019

Then I can see those in ngrep:

U 192.168.7.81:4321 -> 224.0.0.50:9898                                                                                                                                                                             
  {"cmd":"report","model":"gateway","sid":"7811dcdad7a3","short_id":0,"data":"{\"rgb\":0,\"illumination\":681}"}                                                                                                   
#                                                                                                                                 

but not very often. It almost seems like only one GW reports it.

Edit:
Those are reported when there's light change on GW (even to off). But not every 60secs.

Edit2:
Can confirm, they are not reporting that very often. Should be option to poll (gateways).

@stsergo
Copy link
Author

stsergo commented Feb 19, 2019

Edit2:
Can confirm, they are not reporting that very often. Should be option to poll (gateways).

I moved my gateway away from dark room. Reports have really random gaps between.

U 2019/02/19 15:11:32.990091 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":558}"}
U 2019/02/19 15:24:35.336748 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":495}"}
U 2019/02/19 15:49:42.186527 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":433}"}

Edit1:
Every hour if light isn't significantly changing.

U 2019/02/19 15:11:32.990091 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":558}"}
U 2019/02/19 15:24:35.336748 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":495}"}
U 2019/02/19 15:49:42.186527 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":433}"}
U 2019/02/19 15:55:21.450549 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":402}"}
U 2019/02/19 16:55:13.832239 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":323}"}
U 2019/02/19 17:55:06.255823 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":307}"}
U 2019/02/19 18:54:59.046195 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":306}"}
U 2019/02/19 19:54:52.165538 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":306}"}
U 2019/02/19 20:54:44.653476 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":307}"}
U 2019/02/19 21:54:37.861929 192.168.2.204:4321 -> 224.0.0.50:9898 {"cmd":"report","model":"gateway","sid":"04cf8c91566f","short_id":0,"data":"{\"rgb\":0,\"illumination\":306}"}

P.S. I'd disable polling today and gateway disappeared regardless of reports.

@peppekerstens
Copy link

peppekerstens commented Feb 23, 2019

@Danielhiversen

I am not sure if this is a good idea.
It should at least be configurable, and not the default behavior.

Why?

  1. Do you own the 'new' hardware gateways with new firmware and have another working solution?
  2. Does it break existing setups with this new default behavior?
  3. Do you have any information present that the 'broken' firmware will be fixed soon by Xiaomi? Do they have any reason to 'fix' the current behavior? There seems none; everything works fine in their app..
  4. Is there an EASY way for (new) users (using hassio) to change this behavior*?

If all are answered with: 'no' then I urge you to reconsider...

* i have been searching on how to change this behavior and found no clue on how to do this in hassio except for
(1) adding a 'custom_components' folder to config. But this is no custom component, it is part of the system!
(2) do a complete classic (re)install
So how.....?

@@ -112,3 +112,8 @@ def parse_data(self, data, raw_data):
else:
self._state = round(value, 1)
return True

def update(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change the update_entity service will have an effect and users that are affected by the bad firmware can schedule their own update interval with automations. We then don't need to set polling to true for all xiaomi aqara entities.

@peppekerstens
Copy link

Quickie; Firmware 1.4.1_167 came out. Updated one of my gateways to test if this fixed current issue. Not so; behavior remains the same. We need this fix...

@jcastro
Copy link

jcastro commented Feb 24, 2019

This would supposedly fix this #21250 right? I'm currently running Hassio on VM and doesn't work correctly the sensors (sometimes it does sometimes it doesn't). However running Hassio on my pi3 works perfect.

Is there a way I can apply this to Hassio to test it out?

@fernandex00
Copy link

Hope for the fix in hassio

@sonartribe
Copy link

I have a theory...One thing I have noticed, and including myself, is that the people who appear to have most problems all have MAC address of the gateway starting 04:XX:XX:XX:XX:XX.

When I get updates from a sensor, I can see in the debug these appearing as a PUSH and the sensor gets updated.

2019-02-24 20:24:33 DEBUG (Thread-23) [xiaomi_gateway] MCAST (heartbeat) << {'model': 'sensor_ht', 'sid': '158dXXXXXXXXXX', 'cmd': 'heartbeat', 'short_id': 63981, 'data': '{"voltage":2985,"
temperature":"1845","humidity":"5269"}'}
2019-02-24 20:24:33 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Humidity_158dXXXXXXXXXX: 52.7>: {'voltage': 2985, 'temperature': '1845', 'humidity': '5269'}
2019-02-24 20:24:33 DEBUG (MainThread) [homeassistant.components.xiaomi_aqara] PUSH >> <Entity Temperature_158dXXXXXXXXXX: 18.4>: {'voltage': 2985, 'temperature': '1845', 'humidity': '5269'
}

However when I get an illumination update from the gateway I don't get the corresponding PUSH debug message.

2019-02-24 20:20:27 DEBUG (Thread-23) [xiaomi_gateway] MCAST (report) << {'model': 'gateway', 'sid': '04XXXXXXXXXX', 'cmd': 'report', 'short_id': 0, 'data': '{"rgb":1694434079,"illumination
":336}'}

One thing I notice that the entity_id that home assistant set up, is

sensor.illumination_4XXXXXXXXXX
and
light.gateway_light_4XXXXXXXXXX

thus missing the leading zero.

Could this be causing a mismatch between the SID being broadcast and the HA entitiy?

@syssi
Copy link
Member

syssi commented Feb 28, 2019

Superseded by #21453.

@syssi syssi closed this Feb 28, 2019
@ghost ghost removed the in progress label Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Xiaomi gateway light - can't turn off, no colour