Xiaomi Smart Home Suite (very cheap) compatibilty?

Xiaomi, Ikea TRÅDFRI, Philips Hue and more.

Moderator: leecollings

deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo »

Rotation value is a text device who appear once you rotate cube once.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
murtadin
Posts: 62
Joined: Saturday 31 December 2016 15:33
Target OS: Linux
Domoticz version: beta
Contact:

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

Post by murtadin »

corbin wrote:
murtadin wrote:@Corbin - tried today last beta from your git V3.6635 - i have got semi working build without setting ip manual in XiaomiGateway.cpp. Detected all zigbee devices - but still have error with invalid key, when trying to switch zigbee plug or gatweway light for example.

In XiaomiGateway.cpp i see #ifdef _DEBUG - how can i see output?

Code: Select all

cmake -DCMAKE_BUILD_TYPE=Debug .
see https://www.domoticz.com/wiki/Install.txt#Installation
Tried that on both machines (working and not working yet) - no debug messages at all in log.

Code: Select all

./domoticz -www 8080 -sslwww 0 -wwwbind 192.168.111.201 -verbose 2 -log /var/log/domoticz.log -daemon
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Jumper3126 »

I'm very interesting in a posibility to monitor power usage per plug. I understand that in principle this is possible with the xiaomi plugs, but this option has so far not been implemented into domoticz.
Is this just a matter of time, or could this in the end not be feasible at all?

Thanks
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo »

Jumper3126 wrote:I'm very interesting in a posibility to monitor power usage per plug. I understand that in principle this is possible with the xiaomi plugs, but this option has so far not been implemented into domoticz.
Is this just a matter of time, or could this in the end not be feasible at all?

Thanks
That just à matter of gateway Fw who are not as thé same level of the documented API.

Corbin already add this aviability, and device will appear when gateway will send the information.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Jumper3126 »

deennoo wrote:
Jumper3126 wrote:I'm very interesting in a posibility to monitor power usage per plug. I understand that in principle this is possible with the xiaomi plugs, but this option has so far not been implemented into domoticz.
Is this just a matter of time, or could this in the end not be feasible at all?

Thanks
That just à matter of gateway Fw who are not as thé same level of the documented API.

Corbin already add this aviability, and device will appear when gateway will send the information.
Hi deennoo,
Do I understand you correctly that currently you already can get the power usage into Domoticz from these plugs (http://www.gearbest.com/living-applianc ... 44666.html)?
mKotek
Posts: 68
Joined: Wednesday 30 December 2015 23:54
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

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

Post by mKotek »

I have just posted an issue I am facing with Xiaomi Wireless Switch (the round one) here. It would be great if you could comment and provide ideas on how to solve the click issue I am facing.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
mKotek
Posts: 68
Joined: Wednesday 30 December 2015 23:54
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

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

Post by mKotek »

Jumper3126 wrote:
deennoo wrote:
Jumper3126 wrote:I'm very interesting in a posibility to monitor power usage per plug. I understand that in principle this is possible with the xiaomi plugs, but this option has so far not been implemented into domoticz.
Is this just a matter of time, or could this in the end not be feasible at all?

Thanks
That just à matter of gateway Fw who are not as thé same level of the documented API.

Corbin already add this aviability, and device will appear when gateway will send the information.
Hi deennoo,
Do I understand you correctly that currently you already can get the power usage into Domoticz from these plugs (http://www.gearbest.com/living-applianc ... 44666.html)?
My 2 cents on the situation: the documentation provides info on how the data should be reported. The issue is, current data sent by gateway does not conform to the documentation. I sort of expected, the communication about turning on and off the socket does not contain the data as the value is not collected at that very moment and for some reason, gateway does not send the update when measurement is actually made. But this has been my assumption only and Android Mi Home app does get this information somehow.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
levynger
Posts: 87
Joined: Wednesday 21 December 2016 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Israel
Contact:

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

Post by levynger »

mKotek wrote:I have just posted an issue I am facing with Xiaomi Wireless Switch (the round one) here. It would be great if you could comment and provide ideas on how to solve the click issue I am facing.
I have created a small Lua script that does exactly what you've described.
It uses only "Click" to toggle on/off to the xiaomi rgb WiFi light.

I'm currently out of home. I will post the script as reference once I'll get the chance or when I'm back home next week.


Sent from my SM-N920C using Tapatalk
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

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

Post by woody4165 »

deennoo wrote:Rotation value is a text device who appear once you rotate cube once.
Just wrote a small script, but since I'm not a coder, I'm sure it can be optimized... :roll:

In my case, I want that the dimming works only if the lamp is already On.

Code: Select all

commandArray = {}

-- Run only if the cube has been rotated clockwise or anti-clockwise
if devicechanged['Xiaomi Cube Switch'] == "clock_wise" or devicechanged['Xiaomi Cube Switch'] == "anti_clock_wise" then
   -- Runs only if the light is already On
    if (otherdevices['YeeLight Salone'] == "On" or otherdevices['YeeLight Salone'] == "Set Level") then
	-- grab the actual dimming value 
    	actual_dimming = tonumber(otherdevices_svalues['YeeLight Salone'])
        --if the cube has been rotated clockwise and dimming is below 100
        if ((otherdevices['Xiaomi Cube Switch'] == "clock_wise") and actual_dimming < 100) then
            -- need to find only the integer value
            actual_rotation = otherdevices_svalues['Xiaomi Cube Text']
            virgola = string.find(actual_rotation, ",")
            numero = string.sub(actual_rotation, 1, virgola-1)
            -- Add the rotation value to the actual dimming, and if is greater than 100, set it to 100
            new_dim_value = actual_dimming + tonumber(numero)
            if new_dim_value > 100 then
                new_dim_value = 100
            end    
            comando = "Set Level "..new_dim_value
            commandArray['YeeLight Salone']=comando
        end

        --if the cube has been rotated anti-clockwise and dimming is above 1
        if (otherdevices['Xiaomi Cube Switch'] == "anti_clock_wise" and actual_dimming > 1) then
            -- need to find only the integer value
            actual_rotation = otherdevices_svalues['Xiaomi Cube Text']
            virgola = string.find(actual_rotation, ",")
            numero = string.sub(actual_rotation, 1, virgola-1)
            -- Add the rotation value (in this case is a negative value), to the actual dimming, and if is smaller than 1, set it to 1
            new_dim_value = actual_dimming + tonumber(numero)
            if new_dim_value < 1 then
                new_dim_value = 1
            end    
            comando = "Set Level "..new_dim_value
            commandArray['YeeLight Salone']=comando
        end
    end
end


return commandArray

It seems to work, if you have any suggestion, please share it!
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

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

Post by corbin »

murtadin wrote: In XiaomiGateway.cpp i see #ifdef _DEBUG - how can i see output?
Sorry that must be Windows only, try adding

Code: Select all

#define _DEBUG
after the includes to XiaomiGateway.cpp
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
murtadin
Posts: 62
Joined: Saturday 31 December 2016 15:33
Target OS: Linux
Domoticz version: beta
Contact:

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

Post by murtadin »

corbin wrote:
murtadin wrote: In XiaomiGateway.cpp i see #ifdef _DEBUG - how can i see output?
Sorry that must be Windows only, try adding

Code: Select all

#define _DEBUG
after the includes to XiaomiGateway.cpp
Yes it works - now i see some debug messages in logs:

Code: Select all

2017-02-10 12:52:55.588 XiaomiGateway: Using 192.168.111.254 for local IP address.
2017-02-10 12:52:55.588 XiaomiGateway: BINDING UDP TO SPECIFIC LOCAL IP 192.168.111.254
2017-02-10 12:52:55.588 EventSystem: reset all device statuses...
2017-02-10 12:52:55.589 EventSystem: Started
2017-02-10 12:52:55.643 XiaomiGateway: RGB Gateway Detected

Code: Select all

2017-02-10 12:54:19.519 User: Admin initiated a switch command (24/console.living/On)
2017-02-10 12:54:19.519 XiaomiGateway: GetGatewayKey Password - w4nxoquhmew5rpid
2017-02-10 12:54:19.519 XiaomiGateway: GetGatewayKey Token -
2017-02-10 12:54:19.519 XiaomiGateway: GetGatewayKey key - BF814FE7C3205F68F7C3556705AC2092
2017-02-10 12:54:19.670 XiaomiGateway: request {"cmd":"write","model":"plug","sid":"158d000117a188","short_id":9844,"data":"{\"channel_0\":\"on\",\"key\":\"BF814FE7C3205F68F7C3556705AC2092\"}" }
2017-02-10 12:54:19.670 Error: XiaomiGateway: unable to write command - Invalid Key
2017-02-10 12:54:19.670 XiaomiGateway: response {"cmd":"write_ack","sid":"158d000117a188","data":"{\"error\":\"Invalid key\"}"}
2017-02-10 12:54:19.670 XiaomiGateway: SendMessageToGateway failed on first attempt, will try again
2017-02-10 12:54:19.770 XiaomiGateway: GetGatewayKey Password - w4nxoquhmew5rpid
2017-02-10 12:54:19.770 XiaomiGateway: GetGatewayKey Token -
2017-02-10 12:54:19.770 XiaomiGateway: GetGatewayKey key - BF814FE7C3205F68F7C3556705AC2092
2017-02-10 12:54:19.920 XiaomiGateway: request {"cmd":"write","model":"plug","sid":"158d000117a188","short_id":9844,"data":"{\"channel_0\":\"on\",\"key\":\"BF814FE7C3205F68F7C3556705AC2092\"}" }
2017-02-10 12:54:19.920 Error: XiaomiGateway: unable to write command - Invalid Key
2017-02-10 12:54:19.920 XiaomiGateway: response {"cmd":"write_ack","sid":"158d000117a188","data":"{\"error\":\"Invalid key\"}"}
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

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

Post by corbin »

are you receiving any heartbeat messages at all?, eg:

Code: Select all

2017-02-10 21:03:56.951  {"cmd":"heartbeat","model":"switch","sid":"158d000104ed67","short_id":22560,"data":"{}"}
2017-02-10 21:05:03.719  {"cmd":"heartbeat","model":"plug","sid":"158d00010e080c","short_id":58729,"data":"{\"status\":\"off\",\"inuse\":\"0\"}"}
2017-02-10 21:05:22.353  {"cmd":"heartbeat","model":"plug","sid":"158d00011070b4","short_id":62158,"data":"{\"status\":\"off\",\"inuse\":\"1\"}"}
2017-02-10 21:08:16.435  {"cmd":"heartbeat","model":"motion","sid":"158d0000fd32c2","short_id":1950,"data":"{\"status\":\"no_motion\"}"}
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
murtadin
Posts: 62
Joined: Saturday 31 December 2016 15:33
Target OS: Linux
Domoticz version: beta
Contact:

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

Post by murtadin »

corbin wrote:are you receiving any heartbeat messages at all?, eg:

Code: Select all

2017-02-10 21:03:56.951  {"cmd":"heartbeat","model":"switch","sid":"158d000104ed67","short_id":22560,"data":"{}"}
2017-02-10 21:05:03.719  {"cmd":"heartbeat","model":"plug","sid":"158d00010e080c","short_id":58729,"data":"{\"status\":\"off\",\"inuse\":\"0\"}"}
2017-02-10 21:05:22.353  {"cmd":"heartbeat","model":"plug","sid":"158d00011070b4","short_id":62158,"data":"{\"status\":\"off\",\"inuse\":\"1\"}"}
2017-02-10 21:08:16.435  {"cmd":"heartbeat","model":"motion","sid":"158d0000fd32c2","short_id":1950,"data":"{\"status\":\"no_motion\"}"}
no heartbeat messages at all. will try a little experiment later - disable all network interfaces except one.
deennoo
Posts: 784
Joined: Wednesday 10 December 2014 13:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

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

Post by deennoo »

woody4165 wrote:
It seems to work, if you have any suggestion, please share it!
looks like yours, as already says i will share once stable will be release, i don't want to create probleme for those who doesn't follow all beta.
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
Jumper3126
Posts: 105
Joined: Thursday 31 December 2015 15:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Jumper3126 »

mKotek wrote:
Jumper3126 wrote:
deennoo wrote: That just à matter of gateway Fw who are not as thé same level of the documented API.

Corbin already add this aviability, and device will appear when gateway will send the information.
Hi deennoo,
Do I understand you correctly that currently you already can get the power usage into Domoticz from these plugs (http://www.gearbest.com/living-applianc ... 44666.html)?
My 2 cents on the situation: the documentation provides info on how the data should be reported. The issue is, current data sent by gateway does not conform to the documentation. I sort of expected, the communication about turning on and off the socket does not contain the data as the value is not collected at that very moment and for some reason, gateway does not send the update when measurement is actually made. But this has been my assumption only and Android Mi Home app does get this information somehow.
Thanks for the explanation. So for now it remains unclear if these feature can be installed in Domoticz. However, as it works via the app, these plugs are still very economical alternatives for the plugwise plugs :)
mKotek
Posts: 68
Joined: Wednesday 30 December 2015 23:54
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

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

Post by mKotek »

Jumper3126 wrote:
mKotek wrote:
Jumper3126 wrote:
Hi deennoo,
Do I understand you correctly that currently you already can get the power usage into Domoticz from these plugs (http://www.gearbest.com/living-applianc ... 44666.html)?
My 2 cents on the situation: the documentation provides info on how the data should be reported. The issue is, current data sent by gateway does not conform to the documentation. I sort of expected, the communication about turning on and off the socket does not contain the data as the value is not collected at that very moment and for some reason, gateway does not send the update when measurement is actually made. But this has been my assumption only and Android Mi Home app does get this information somehow.
Thanks for the explanation. So for now it remains unclear if these feature can be installed in Domoticz. However, as it works via the app, these plugs are still very economical alternatives for the plugwise plugs :)
The whole integration is already defined to report power consumption as far as I understand. When only gateway will start pushing this information out as described in the documentation, we shall see it in Domoticz. But it is not clear, why gateway is not sending data as describet so it may be the bug or a feature :D
Last edited by mKotek on Friday 10 February 2017 14:50, edited 1 time in total.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post by Derik »

I do have the cube camera from Xiaomi.
Very nice camera great resolution.
Only 1 thing i cannot see the camera in my lan [ just the IP, not a ui ] , only visible in the Xiaomi app.

Perhaps some have this camera in Domoticz working, like a normal IP camera.

I ask Xiaomi, only no answer...
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
mKotek
Posts: 68
Joined: Wednesday 30 December 2015 23:54
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Poland
Contact:

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

Post by mKotek »

Derik wrote:I do have the cube camera from Xiaomi.
Very nice camera great resolution.
Only 1 thing i cannot see the camera in my lan [ just the IP, not a ui ] , only visible in the Xiaomi app.

Perhaps some have this camera in Domoticz working, like a normal IP camera.

I ask Xiaomi, only no answer...
Before you ask such questions, please take some time to read the whole thread. Just 4 pages back, there was a link give to the site that has tackled the cameras (if you mean Xiaofeng ones) to make them available on the network: see this post and good luck. I am still waiting for mine.
Michal 'Kotek', greetings from Poland. Zapraszam na mój blog o automatyce domowej po polsku: http://www.ukotka.com.
Derik
Posts: 1602
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

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

Post by Derik »

Uhm.. sorry

Only i see a hack different like a lan ip web gui...

Then my boards messages are bad .
So sorry
Thanks for your info


Is there some one that has this hack working? Can i brick with this hack?

This is my Camera:
http://www.banggood.com/Xiaomi-XiaoFang ... mds=search
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
corbin
Posts: 463
Joined: Saturday 20 August 2016 22:57
Target OS: Windows
Domoticz version: Beta
Location: Brisbane, Australia
Contact:

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

Post by corbin »

Please start a new thread for this camera, apart from being branded with Xiaomi, it is different from the Xiaomi Gateway/smart hub.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest