Page 86 of 123

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

Posted: Wednesday 02 August 2017 18:05
by theo69
Hey did anybody trying to integrate this beautiful desklamp von Xiaomi: Xiaomi Mijia Smart LED Desk Lamp

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

Posted: Wednesday 02 August 2017 19:43
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..

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

Posted: Wednesday 02 August 2017 23:55
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) :)

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

Posted: Thursday 03 August 2017 14:41
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?

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

Posted: Thursday 03 August 2017 15:11
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

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

Posted: Thursday 03 August 2017 15:37
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.

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

Posted: Friday 04 August 2017 15:01
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?

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

Posted: Friday 04 August 2017 23:14
by corbin
@jlmb22 change your Lua script to 'Device' instead of 'All'

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

Posted: Friday 04 August 2017 23:20
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.

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

Posted: Saturday 05 August 2017 9:41
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...

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

Posted: Saturday 05 August 2017 10:38
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...

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

Posted: Saturday 05 August 2017 12:01
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.

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

Posted: Saturday 05 August 2017 19:34
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.

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

Posted: Saturday 05 August 2017 20:30
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...

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

Posted: Sunday 06 August 2017 12:36
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

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

Posted: Sunday 06 August 2017 12:39
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...

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

Posted: Sunday 06 August 2017 16:44
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?

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

Posted: Sunday 06 August 2017 16:46
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?

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

Posted: Sunday 06 August 2017 16:51
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

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

Posted: Sunday 06 August 2017 17:44
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.