Page 1 of 1

Xiaomi Doorbell

Posted: Saturday 17 February 2018 12:45
by BarryT
Hi everyone,

i have some troubles with the usage of the doorbell / light in xiaomi..
I have a switch, wich been pressed at the front door.
This is just a "chime", with an on button.
That is working, but when i want to use it with the doorbell in the xiaomi, i dont get any sound.
I use the blocky for this, like mentioned in the wiki, but when i switch on my light scenes the doorbell is ringing?? :(
What is going on here?
I just want to use the doorbell when i pressed on the button, and the rgb led without the sound!

Thanks!

Re: Xiaomi Doorbell

Posted: Saturday 10 March 2018 14:24
by dcanogar
Hi,


I found this Lua code that works for me:

Code: Select all

commandArray = {}

-- sound values:
-- 10 = Doorbell
-- 20 = Knock
-- 30 = Hilarious
-- 40 = Alarm clock

sound = 10
volume = 80

if devicechanged['Timbre'] == 'Group On' then
	commandArray['Xiaomi Gateway Volume']='Set Level '..tostring(volume)
	commandArray['Xiaomi Gateway Doorbell']='Set Level '..tostring(sound)
end

return commandArray

Re: Xiaomi Doorbell

Posted: Sunday 18 March 2018 21:13
by BarryT
dcanogar wrote: Saturday 10 March 2018 14:24 Hi,


I found this Lua code that works for me:

Code: Select all

commandArray = {}

-- sound values:
-- 10 = Doorbell
-- 20 = Knock
-- 30 = Hilarious
-- 40 = Alarm clock

sound = 10
volume = 80

if devicechanged['Timbre'] == 'Group On' then
	commandArray['Xiaomi Gateway Volume']='Set Level '..tostring(volume)
	commandArray['Xiaomi Gateway Doorbell']='Set Level '..tostring(sound)
end

return commandArray
thanks!
i've done it with a blocky script now, as simple as it is, it works perfectly :)
if button doorbell=on set gateway volume 10 and doorbell level 10

button doorbell = push on button
the led is done by a json when pressed on the doorbell button:
ON: http://IP:PORT/json.htm?type=command&param=setcolbrightnessvalue&idx=GATEWAYIDX&hex=27024E&brightness=100&iswhite=false
OFF: http://IP:PORT/json.htm?type=command&param=setcolbrightnessvalue&idx=GATEWAYIDX&hex=0000&brightness=100&iswhite=false

:)