Xiaomi Smart Home Suite (very cheap) compatibilty?

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

Moderator: leecollings

theo69
Posts: 60
Joined: Sunday 04 June 2017 12:57
Target OS: Raspberry Pi / ODroid
Domoticz version: la. beta
Location: World
Contact:

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

Post by theo69 »

Hey did anybody trying to integrate this beautiful desklamp von Xiaomi: Xiaomi Mijia Smart LED Desk Lamp
Love my Xiaomi Gateway in connection with homebridge and domoticz on my PI3
Xiaomi Gateway Domoticz Wiki
Derik
Posts: 1601
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 hope that the alarms integrated to domoticz..
Looks great...
When my arrived @ home.. The great sirene :-)

When she left... my favorite sound...
And perhaps the greatest option... i do have a great alarm..
All my doors have a contact..
So when i can switch the alarm,, should be perfect..

I hope..
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
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

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

Post by Nautilus »

theo69 wrote:Hey did anybody trying to integrate this beautiful desklamp von Xiaomi: Xiaomi Mijia Smart LED Desk Lamp
I have nothing against posting good deals here on the board, but in the name of openness / transparency I'd like to see a mentioning if there is an affiliate link used (yes, one can see it in the link address of course, but would be clearer if it is also mentioned in the post) :)
Luigi87
Posts: 79
Joined: Thursday 17 March 2016 14:58
Target OS: Linux
Domoticz version:
Location: Pijnacker, the Netherlands
Contact:

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

Post by Luigi87 »

Hi guys, I have a question about the Xiaomi gateway. I would like to implement a presence detection trough the ZigBee protocol.
there are tags like: this one from Samsung, who communicate with the smartthings hub to confirm you are there or not.

Now the problem: the Samsung smartthings hub is realy expensive (around 100 bucks), so i would like to use the Xiaomi Gateway and maybe an other ZigBee tag with the same functionality's
are there people here with experience with this? so which hardware do you used?
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

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

Post by pvm »

This functionality needs to be supported by the gateway. As far as I know xiaomi does not support this at the moment.
You can have a look at the thread about the ikea Tradfri gateway. Someone mentioned a generic zombie gateway if I remember correctly
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
Luigi87
Posts: 79
Joined: Thursday 17 March 2016 14:58
Target OS: Linux
Domoticz version:
Location: Pijnacker, the Netherlands
Contact:

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

Post by Luigi87 »

pvm wrote:This functionality needs to be supported by the gateway. As far as I know xiaomi does not support this at the moment.
You can have a look at the thread about the ikea Tradfri gateway. Someone mentioned a generic zombie gateway if I remember correctly
Thanks, I was afraid this also has some software needed in the gateway.
jlmb22
Posts: 2
Joined: Friday 04 August 2017 14:58
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Location: France
Contact:

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

Post by jlmb22 »

levynger wrote:
woody4165 wrote:
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!
thanks, recieved my cube, and used your script, modified it abit to allow turning on/off as well based on rotation is someone interfested in:

Code: Select all

-- Run only if the cube has been rotated clockwise or anti-clockwise
if devicechanged['Xiaomi Cube'] == "clock_wise" or devicechanged['Xiaomi Cube'] == "anti_clock_wise" then
   -- Runs only if the light is already On
    --if (otherdevices['CorridorLight'] == "On" or otherdevices['CorridorLight'] == "Set Level") then
   -- grab the actual dimming value 
       actual_dimming = tonumber(otherdevices_svalues['CorridorLight'])
       print("the Current YeeeLightSvalue: " .. actual_dimming)
        --if the cube has been rotated clockwise and dimming is below 100
        if ((otherdevices['Xiaomi Cube'] == "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['CorridorLight']=comando
        end

        --if the cube has been rotated anti-clockwise and dimming is above 1
        if (otherdevices['Xiaomi Cube'] == "anti_clock_wise" and actual_dimming > 1) then
            -- need to find only the integer value
            print("a test print")
            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)
            print("the new value to reduce to: " .. new_dim_value)
            if new_dim_value <= 1 then
                new_dim_value = 0
            end    
            comando = "Set Level "..new_dim_value
            commandArray['CorridorLight']=comando
        end
    --end
end


return commandArray

Hi, I'm trying to use your script for the same purpose but I have that error:
/usr/local/domoticz/var/scripts/lua/script_device_onkyo.lua:14: bad argument #1 to 'find' (string expected, got nil)

I'm totally newbie with domoticz and script (if it needed to be said...)

Anyone can help me please?
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 »

@jlmb22 change your Lua script to 'Device' instead of 'All'
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
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 »

Nautilus wrote:
theo69 wrote:Hey did anybody trying to integrate this beautiful desklamp von Xiaomi: Xiaomi Mijia Smart LED Desk Lamp
I have nothing against posting good deals here on the board, but in the name of openness / transparency I'd like to see a mentioning if there is an affiliate link used (yes, one can see it in the link address of course, but would be clearer if it is also mentioned in the post) :)
@theo69 It is good to see you promoting the Xiaomi products, but it is also good manners to to include a note that you get a cut from each purchase, including the affiliate links you added on the Wiki.
Question about the Xiaomi Gateway in Domoticz? Please check the Wiki first: https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)
jlmb22
Posts: 2
Joined: Friday 04 August 2017 14:58
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Location: France
Contact:

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

Post by jlmb22 »

corbin wrote:@jlmb22 change your Lua script to 'Device' instead of 'All'
Thanks a lot for helping, but I don't write this script in domoticz, I copy it in the folder scripts/lua.


If I write a script directly in Domoticz, then I have this error :
2017-08-05 09:27:54.058 Error: EventSystem: in /usr/local/domoticz/var/scripts/dzVents/runtime/dzVents.lua: cannot open /usr/local/domoticz/var/scripts/dzVents/runtime/dzVents.lua: No such file or directory

According to this thread:viewtopic.php?f=17&t=2620&start=1060, it's because my domoticz is installed on a synology...
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 »

corbin wrote:
Nautilus wrote:
theo69 wrote:Hey did anybody trying to integrate this beautiful desklamp von Xiaomi: Xiaomi Mijia Smart LED Desk Lamp
I have nothing against posting good deals here on the board, but in the name of openness / transparency I'd like to see a mentioning if there is an affiliate link used (yes, one can see it in the link address of course, but would be clearer if it is also mentioned in the post) :)
@theo69 It is good to see you promoting the Xiaomi products, but it is also good manners to to include a note that you get a cut from each purchase, including the affiliate links you added on the Wiki.
On my side adding affiliate to gearbest link can be ok if :.
Those affiliate link are for the dev who add xiaomi to domoticz....and this help to add device to Domoticz

If that just a way to win money please go back to your friend or creat a blog only for this...
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / Tasmota / MQTT / BLE / Zigate
http://domo-attitude.fr
martijnm
Posts: 26
Joined: Thursday 04 February 2016 13:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.530
Location: Emmen, Drenthe
Contact:

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

Post by martijnm »

I fully agree on this one. It should not be allowed for regular users to spam affiliate links in the forum or in the wiki. I would encourage the Domoticz team to create an affiliate account at Gearbest and replace the links with their own affiliate links. This way all income generated will flow into the Domoticz project.
wss2
Posts: 5
Joined: Saturday 05 August 2017 19:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by wss2 »

Hi folks,

I'm new to forum and Domoticz world, am I trying to create a lua script to send the arming signal or double click on the gateway is it possible?

I can send commands via domoticz to the gateway but I can not do these actions or enable the automates already created in the app.
islandman
Posts: 53
Joined: Saturday 05 August 2017 20:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by islandman »

Hi I am to new to domoticz. I switched from pure homebridge to this. I have one of the great gateways from Xiaomi. However i bought one of this neutral wire single switches. Are there any tricks to get them show up in domoticz? Its working great with all the other wall switches without neutral wire.

Thanks for your help...
levynger
Posts: 87
Joined: Wednesday 21 December 2016 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Israel
Contact:

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

Post by levynger »

wss2 wrote:Hi folks,

I'm new to forum and Domoticz world, am I trying to create a lua script to send the arming signal or double click on the gateway is it possible?

I can send commands via domoticz to the gateway but I can not do these actions or enable the automates already created in the app.
Here is an example of simple code to activate Domoticz security panel from Xiaomi Wireless Switch, and toggle sound from the Gateway.
Not sure if Xiaomi's Internal Security module is accessible by API..

Code: Select all

if devicechanged['Xiaomi Wireless Switch 2'] == 'Double Click' then
    if otherdevices['Security Panel'] == 'Arm Away' or otherdevices['Security Panel'] == 'Arm home' then
    commandArray['Xiaomi Gateway MP3'] = 'Off'
    print("Securty Disarmed")
    commandArray['Variable:XiaomiMP3']='10003'
    print("the MP3 Var is: " .. tostring(XiaomiMP3))
    commandArray['Xiaomi Gateway MP3'] = 'On'
    commandArray['Security Panel'] = 'Disarm'
    
    else
    print("security Armed")
    commandArray['Xiaomi Gateway MP3'] = 'Off'
    commandArray['Variable:XiaomiMP3']='10001'
    print("the MP3 Var is: " .. tostring(XiaomiMP3))
    commandArray['Xiaomi Gateway MP3'] = 'On'
    commandArray['Security Panel'] = 'Arm Away AFTER 30'
    end
end

return commandArray
levynger
Posts: 87
Joined: Wednesday 21 December 2016 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Israel
Contact:

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

Post by levynger »

islandman wrote:Hi I am to new to domoticz. I switched from pure homebridge to this. I have one of the great gateways from Xiaomi. However i bought one of this neutral wire single switches. Are there any tricks to get them show up in domoticz? Its working great with all the other wall switches without neutral wire.

Thanks for your help...
the Neutral Version are not (yet) supported.. however it is planned..
i have sync'ed Corbin's git, i will try to assist him with it. i have received single neutral version...
islandman
Posts: 53
Joined: Saturday 05 August 2017 20:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by islandman »

levynger wrote: the Neutral Version are not (yet) supported.. however it is planned..
i have sync'ed Corbin's git, i will try to assist him with it. i have received single neutral version...
Thanks for the Info, do you have a time frame?
wss2
Posts: 5
Joined: Saturday 05 August 2017 19:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by wss2 »

levynger wrote:

Code: Select all

if devicechanged['Xiaomi Wireless Switch 2'] == 'Double Click' then
    if otherdevices['Security Panel'] == 'Arm Away' or otherdevices['Security Panel'] == 'Arm home' then
    commandArray['Xiaomi Gateway MP3'] = 'Off'
    print("Securty Disarmed")
    commandArray['Variable:XiaomiMP3']='10003'
    print("the MP3 Var is: " .. tostring(XiaomiMP3))
    commandArray['Xiaomi Gateway MP3'] = 'On'
    commandArray['Security Panel'] = 'Disarm'
    
    else
    print("security Armed")
    commandArray['Xiaomi Gateway MP3'] = 'Off'
    commandArray['Variable:XiaomiMP3']='10001'
    print("the MP3 Var is: " .. tostring(XiaomiMP3))
    commandArray['Xiaomi Gateway MP3'] = 'On'
    commandArray['Security Panel'] = 'Arm Away AFTER 30'
    end
end

return commandArray
Thank you for the reply.
Do you think it's possible to activate a gateway scene?
levynger
Posts: 87
Joined: Wednesday 21 December 2016 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Israel
Contact:

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

Post by levynger »

wss2 wrote:
levynger wrote:

Code: Select all

if devicechanged['Xiaomi Wireless Switch 2'] == 'Double Click' then
    if otherdevices['Security Panel'] == 'Arm Away' or otherdevices['Security Panel'] == 'Arm home' then
    commandArray['Xiaomi Gateway MP3'] = 'Off'
    print("Securty Disarmed")
    commandArray['Variable:XiaomiMP3']='10003'
    print("the MP3 Var is: " .. tostring(XiaomiMP3))
    commandArray['Xiaomi Gateway MP3'] = 'On'
    commandArray['Security Panel'] = 'Disarm'
    
    else
    print("security Armed")
    commandArray['Xiaomi Gateway MP3'] = 'Off'
    commandArray['Variable:XiaomiMP3']='10001'
    print("the MP3 Var is: " .. tostring(XiaomiMP3))
    commandArray['Xiaomi Gateway MP3'] = 'On'
    commandArray['Security Panel'] = 'Arm Away AFTER 30'
    end
end

return commandArray
Thank you for the reply.
Do you think it's possible to activate a gateway scene?
You want to activate internal xiaomi app scene? Or Domoticz scene?

Sent from my SM-G9287 using Tapatalk
wss2
Posts: 5
Joined: Saturday 05 August 2017 19:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by wss2 »

levynger wrote: You want to activate internal xiaomi app scene?
Now that you tell me so I understand the whipped that I've said.

I try to explain it better.
I would like to send a double click to the gateway as if the domoticz button was a virtual switch so the gateway believes that the switch I own been pressed
Sorry for my bad english.
Post Reply

Who is online

Users browsing this forum: peterbos, RonkA and 1 guest