Page 123 of 123

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Tuesday 10 March 2020 21:16
by Geitje
I guess there is no guide, you probably need coding skills? You might want to try to propose it here?

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Monday 16 March 2020 21:51
by Huupke
Coding skills I have. I also ordered a second Pi for development so my existing Pi can keep on running a stable release.

This is what I have so far on the Aqara Wireless Relay Controller(2 Channels).

I've the following messages when turning both channels on and off once:
2020-03-16 21:26:15.831 Status: XiaomiGateway (ID=2): unhandled model: , name: Xiaomi Switch
2020-03-16 21:26:15.831 Status: {"cmd":"heartbeat","model":"","sid":"158d0003cbe6e8","short_id":44412,"data":"{\"voltage\":3600}"}
2020-03-16 21:26:42.490 Status: XiaomiGateway (ID=2): unhandled model: , name: Xiaomi Switch
2020-03-16 21:26:42.490 Status: {"cmd":"report","model":"","sid":"158d0003cbe6e8","short_id":44412,"data":"{\"channel_0\":\"on\"}"}
2020-03-16 21:26:47.391 Status: XiaomiGateway (ID=2): unhandled model: , name: Xiaomi Switch
2020-03-16 21:26:47.391 Status: {"cmd":"report","model":"","sid":"158d0003cbe6e8","short_id":44412,"data":"{\"channel_1\":\"on\"}"}
2020-03-16 21:26:51.318 Status: XiaomiGateway (ID=2): unhandled model: , name: Xiaomi Switch
2020-03-16 21:26:51.318 Status: {"cmd":"report","model":"","sid":"158d0003cbe6e8","short_id":44412,"data":"{\"channel_1\":\"off\"}"}
2020-03-16 21:26:53.828 Status: XiaomiGateway (ID=2): unhandled model: , name: Xiaomi Switch
2020-03-16 21:26:53.828 Status: {"cmd":"report","model":"","sid":"158d0003cbe6e8","short_id":44412,"data":"{\"channel_0\":\"off\"}"}
2020-03-16 21:27:38.541 Status: XiaomiGateway (ID=2): unhandled model: , name: Xiaomi Switch
2020-03-16 21:27:38.541 Status: {"cmd":"report","model":"","sid":"158d0003cbe6e8","short_id":44412,"data":"{\"channel_0\":\"off\"}"}
2020-03-16 21:27:38.595 Status: XiaomiGateway (ID=2): unhandled model: , name: Xiaomi Switch
2020-03-16 21:27:38.595 Status: {"cmd":"report","model":"","sid":"158d0003cbe6e8","short_id":44412,"data":"{\"channel_1\":\"off\"}"}
2020-03-16 21:27:40.583 Status: XiaomiGateway (ID=2): unhandled model: , name: Xiaomi Switch
2020-03-16 21:27:40.584 Status: {"cmd":"heartbeat","model":"","sid":"158d0003cbe6e8","short_id":44412,"data":"{\"voltage\":3600}"}
Model seems to be empty so I hope that doesn't give a problem with in 'XiaomiGateway::xiaomi_udp_server::handle_receive'. I was also wondering what the unit code would be, where are these numbers defined?

Code: Select all

if (xcmd->unitcode == 8) {
I see all these magic numbers in the XiaomiGateway::WriteToHardware method and I hoped to find these codes somewhere, anybody? Do I just take the next unitcode available?

This relay should work very similar to the 'plug' (unitcode == 1 ) or even better the wired dual channel switch named 'ctrl_neutral2' (xcmd->unitcode == 9 || xcmd->unitcode == 10).

Also what are these 'xcmd->subtype', 'sid' and 'short_id'. I see sometimes they are static and some are variable. I even see static + variable like this:

Code: Select all

message = "{\"cmd\":\"write\",\"model\":\"curtain\",\"sid\":\"158d00" + sid + "\",\"short_id\" ....
I see I'm not the first encountering the empty model which is blocking:
https://www.domoticz.com/forum/viewtopi ... el#p233410

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Monday 30 March 2020 20:38
by Huupke
I've prepared a PR with a more clean Xiaomi Gateway implementation in preparation of adding support for new devices. Could someone have a look at my PR? Let me know if this is in line with the guidelines.

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Tuesday 31 March 2020 22:03
by Huupke
Above PR is already merged.

I have some new improvements in the 'write' method of the Xiaomi Gateway code. Could someone test my branch with a wired wall switch, for instance:
ctrl_neutral1
ctrl_ln1
ctrl_ln1.aq1
ctrl_neutral2
ctrl_ln2
ctrl_ln2.aq1

see: https://github.com/Huupke/domoticz/tree ... mi-methods

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Thursday 02 April 2020 11:30
by Huupke
I was able to test it with a ctrl_ln2.aq. Anyone with a single rocker?

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Tuesday 07 April 2020 20:57
by Huupke
Did someone file an issue at Xiaomi or Aqara with success?

Via de Xiaomi Mi Home app I filed several 'feedback' issues. On one I got the response to ask my question in the 'developer forum': Aqara IOT OpenCloud but I was not able to register myself as I don't know what to fill in for 'ID card number'.

Also when going directly to the forum I don't see any link to signup or create an account. Anyone succeeded?

BTW, I found quite some extra documentation and information:
http://docs.opencloud.aqara.com/en/guid ... tion/#home
https://github.com/aqara

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 02 May 2020 9:44
by Huupke
Huupke wrote: Tuesday 07 April 2020 20:57 Did someone file an issue at Xiaomi or Aqara with success?

Via de Xiaomi Mi Home app I filed several 'feedback' issues. On one I got the response to ask my question in the 'developer forum': Aqara IOT OpenCloud but I was not able to register myself as I don't know what to fill in for 'ID card number'.

Also when going directly to the forum I don't see any link to signup or create an account. Anyone succeeded?

BTW, I found quite some extra documentation and information:
http://docs.opencloud.aqara.com/en/guid ... tion/#home
https://github.com/aqara
You can create an account with and 'ID card number' of 18 digits, all '1's works. I've posted a request for fixing 'ZNLDP12LM' and 'LLKZMK11LM'.

Maybe emailing with '[email protected]' also works but I haven't got any response yet.

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Friday 18 December 2020 8:10
by fantom
Can anyone may add support for thermometer 2 (LYWSD03MMC) ?

Fantom

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 22 May 2021 15:13
by Huupke
I've created a 'workaround' for devices that do not report a model via the gateways API. For now this only works for the Xiaomi Aqara relais LLKZMK11LM (lumi.relay.c2acn01 or relay.c2acn01).

Branch on my fork:
https://github.com/Huupke/domoticz/tree ... mi-devices

See also issues that could potentially be closed with a PR for this 'fix':
#3577
#3769
#4029

Some feedback on the code would be great and you're welcome to test it on your own setup of course.
https://github.com/domoticz/domoticz/pull/4839

For usage you can either add some hardcoded values in the DeviceSupport but probably easier is to add a user variable named 'XiaomiDeviceSupportRelais'. You can add a single device ID like '158d00045c25cf' or comma separated for multiple like this: '158d00045c25cf,158d0003cbe6e8'. Notice always the prefix of '158d00' with respect to what you see in the 'Devices' overview UI.

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 19 June 2021 6:28
by abaratian
Hi everyone,
I have a problem with the xiaomi gateway. I have been using the hub for about 4 years now and recently my xiaomi devices have stopped working. I get 'Error: Xiaomi Gateway: unable to write command - Invalid key' in the log. I cant find the option for the lan passcode. I installed an old version of the app and renewed the passcode and updated in domoticz, but no luck.
can anyone help me resolve this?
-----------------------------------
UPDATAE: the problem was with the firewall blocking port 9898

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Wednesday 21 July 2021 13:53
by askold
Xiaomi aquara temperature, humidity and pressure sensor WSDCGQ11LM connected through the DGNWG02LM hub. The domoticz updates the data once an hour. At the same time, the sensor itself measures much more often, which can be seen in Mi Home. The hub, therefore, can also transmit information more often. But how do you get it to domoticz? I wanted to use this sensor for automatic fan control, but once an hour is not good enough.

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Thursday 16 September 2021 20:21
by Huupke
askold wrote: Wednesday 21 July 2021 13:53 Xiaomi aquara temperature, humidity and pressure sensor WSDCGQ11LM connected through the DGNWG02LM hub. The domoticz updates the data once an hour. At the same time, the sensor itself measures much more often, which can be seen in Mi Home. The hub, therefore, can also transmit information more often. But how do you get it to domoticz? I wanted to use this sensor for automatic fan control, but once an hour is not good enough.
For some HW there are multiple 'devices' created. For instance for the 'Temperature' sensor the following devices are created:
  • Temp + Humidity + Baro
  • Temp + Humidity
  • Temp
Some of these devices are updated more than the other for (to me) an unknown reasons. It's on my TODO list to look into why one device would update more often the temperature than the other. For now I would pick the device that receives the most updates. I'm using mostly the 'Temp + Humidity' type.

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Friday 19 November 2021 19:57
by DAVIZINHO
Hello.
I have the Last beta (2021.1.13872) in docker and my 3 xiaomi gateways stop working. It lost the connection an restart every hour.

Someone whith the same error?