Page 30 of 123
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Friday 27 January 2017 22:14
by murtadin
@Corbin
Compiled binaries from your sources - can't control zigbee sockets too.
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 1:53
by corbin
deennoo wrote:
Xiaomi Cube + Yeelight : Rotative dimmer !
Cool!
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 2:15
by corbin
levynger wrote:
I though removing it before sending to HW again..
the other issue was it could overflow the maximum int value, eg:
shortened sid hex: 012932CF
add 1 to the front to signify switch type: 1012932CF
convert 1012932CF to int: 4314444495
maximum int value: 2147483647
but if we reduced the hex string to 7 chars it could work. That would be assuming that the first number is always going to be 0 when shortened to 8 chars.
levynger wrote:
UPDATE: found how to make 2 on/off type for the same HW.. had to change the xcmd.unitnumber before providing it to mainworker!
did you want to have 2 devices for the same switch?
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 7:10
by derrij
Whether it is possible to bind domoticz(Xiaomi gateway) to network interface?
It looks like, right now, it can not be started on router.
When I start it like this, Raspberry Pi-Domoticz can see the gateway.
Code: Select all
router
192.168.1.1
|
____________________________
| |
Xiaomi Gateway Raspberry Pi-Domoticz
192.168.1.11 192.168.1.190
But when i start domoticz on router 192.168.1.1, Domoticz can't see the gateway
Code: Select all
router
192.168.1.1 Domoticz
|
____________________________
| |
Xiaomi Gateway Raspberry Pi
192.168.1.11 192.168.1.190
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 8:01
by levynger
corbin wrote:levynger wrote:
I though removing it before sending to HW again..
the other issue was it could overflow the maximum int value, eg:
shortened sid hex: 012932CF
add 1 to the front to signify switch type: 1012932CF
convert 1012932CF to int: 4314444495
maximum int value: 2147483647
but if we reduced the hex string to 7 chars it could work. That would be assuming that the first number is always going to be 0 when shortened to 8 chars.
yes, at certian point i have figured this one out, and dripped all changes andnreverted back to your original code, now using array strings, as you have suggested, and adding the ID of the ctrl2 devices there.
and in writetohardware function, i can identify this device by matching the xcmd id with the strings array.
levynger wrote:
UPDATE: found how to make 2 on/off type for the same HW.. had to change the xcmd.unitnumber before providing it to mainworker!
did you want to have 2 devices for the same switch?
indeed, seems more logical to have 2 seperated on/off switches for the ctrl2 and a single on/off for the ctrl1
for the wireless switch (sw086) it should remain slector , as there is additonal trigger i have missed (both pressed).
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 8:36
by deennoo
Sw086 simple switch wireless only send 'click' for the moment
For ctrl2 (wired dual switch) send on/off for each button and click both for when click both.
For ctrl2 need 3 devices : on/off for each button and one push on for click both
Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 8:54
by levynger
deennoo wrote:Sw086 simple switch wireless only send 'click' for the moment
For ctrl2 (wired dual switch) send on/off for each button and click both for when click both.
For ctrl2 need 3 devices : on/off for each button and one push on for click both
Ctrl2 doesn't have both click option.
It's only for the wireless.
You can always create group switch to turn both off/on..
Sent from my SM-N920C using Tapatalk
Re: RE: Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 10:49
by deennoo
levynger wrote:deennoo wrote:Sw086 simple switch wireless only send 'click' for the moment
For ctrl2 (wired dual switch) send on/off for each button and click both for when click both.
For ctrl2 need 3 devices : on/off for each button and one push on for click both
Ctrl2 doesn't have both click option.
It's only for the wireless.
You can always create group switch to turn both off/on..
Sent from my SM-N920C using Tapatalk
Your right, i made inverssion with wireless one
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 16:16
by pikapt
@corbin i'm having random errors: "2017-01-28 15:11:05.873 Error: XiaomiGateway: unable to write command - Invalid Key"
They come and go very randomly i'm not sure if it's due to the device that is trying to be triggered is too far away from router (zigbee switch, which is around 8 m from router). Anyway we can debug this?
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 16:39
by levynger
@corbin, added 2 new patches to your github for the cpp and the header file.
its a big change, as discuss previously in in this thread:
1) added string array to store all ID of the ctrl_neutral (1+2), so can be identified when creating them in Database, using "Unit Field" (for the dual switch), and when using from UI as well.
1) changed the ctrl_neutrals to on/off switches (i think upgrades will have to change it manually, or clean their deviceStatus table from ther database, as it wont change an exiting ID in this table
seems to work nicely here on my ctrl_neutral2 device, this time, kept in mind to deal with ctrl_neutral1 device, eventhough i dont have it.
happy weekend..

- Capture.PNG (68.31 KiB) Viewed 2386 times
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 16:49
by levynger
pikapt wrote:@corbin i'm having random errors: "2017-01-28 15:11:05.873 Error: XiaomiGateway: unable to write command - Invalid Key"
They come and go very randomly i'm not sure if it's due to the device that is trying to be triggered is too far away from router (zigbee switch, which is around 8 m from router). Anyway we can debug this?
not sureits related to the fact its far, this is the gateway answer, probably before even trying to reach your device..
does it happen after some command sent fine? is it for specific device? which one?
it may happen when starting the server, and the gateway didnt send the key for the first time.
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 22:31
by corbin
pikapt wrote:@corbin i'm having random errors: "2017-01-28 15:11:05.873 Error: XiaomiGateway: unable to write command - Invalid Key"
They come and go very randomly i'm not sure if it's due to the device that is trying to be triggered is too far away from router (zigbee switch, which is around 8 m from router). Anyway we can debug this?
I've seen this too. What could be happening is the encryption token changes on the gateway and Domoticz sends the control message before the new token has been processed.
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Saturday 28 January 2017 22:34
by corbin
levynger wrote:@corbin, added 2 new patches to your github for the cpp and the header file.
Thank you, I would have had much trouble doing it since I don't have these switches.
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Sunday 29 January 2017 13:09
by levynger
corbin wrote:levynger wrote:@corbin, added 2 new patches to your github for the cpp and the header file.
Thank you, I would have had much trouble doing it since I don't have these switches.
Thanks, updated from your git & compiled - seems to be working fine..
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Sunday 29 January 2017 14:10
by pikapt
@corbin i have a suggestion to make regarding the xiaomi switch: if we press the switch (one,twice etc), domoticz is able to get that from xiaomi hub but the state is not updated to off after that. That means that in every script we should include an update to the switch status itself to turn it off otherwise domoticz will be triggering the script until the status is changed. Can we include a logic on the switch itself to set it to off everytime a new event is received from the hub? or, does it make sense to do that?
Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Sunday 29 January 2017 15:17
by jjnj
pikapt wrote:@corbin i have a suggestion to make regarding the xiaomi switch: if we press the switch (one,twice etc), domoticz is able to get that from xiaomi hub but the state is not updated to off after that. That means that in every script we should include an update to the switch status itself to turn it off otherwise domoticz will be triggering the script until the status is changed. Can we include a logic on the switch itself to set it to off everytime a new event is received from the hub? or, does it make sense to do that?
I think if changing the current behaviour, it should be optional. In my case its nice to see which action is preformed last for example.
Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Sunday 29 January 2017 16:11
by deennoo
pikapt wrote:@corbin i have a suggestion to make regarding the xiaomi switch: if we press the switch (one,twice etc), domoticz is able to get that from xiaomi hub but the state is not updated to off after that. That means that in every script we should include an update to the switch status itself to turn it off otherwise domoticz will be triggering the script until the status is changed. Can we include a logic on the switch itself to set it to off everytime a new event is received from the hub? or, does it make sense to do that?
I remove this fonction, i think it's not usefull to set a switch to Off as we can't do it by our self (by clicking i mean).
You can set a returne to off by your self using : turn to off timer.
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Sunday 29 January 2017 16:28
by pikapt
Yeah domoticz its actually reacting to changes, so even if status is currently at "click", scripts are only triggered if a "new click" is found so i'll just set to off in the scripts! Thanks!
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Sunday 29 January 2017 17:11
by pikapt
if (result == false) {
//send the message again
_log.Log(LOG_STATUS, "XiaomiGateway: SendMessageToGateway failed on first attempt, will try again");
sleep_milliseconds(100);
result = SendMessageToGateway(message);
pretty cool! cheers corbin
Re: Xiaomi Smart Home Suite (very cheap) compatibilty?
Posted: Sunday 29 January 2017 19:37
by corbin
pikapt wrote:Yeah domoticz its actually reacting to changes, so even if status is currently at "click", scripts are only triggered if a "new click" is found so i'll just set to off in the scripts! Thanks!
To clarify what deennoo said above, you can actually set it to turn off after x seconds in the Domoticz web GUI.