Page 1 of 1
Security - blocky with Xiaomi gateway
Posted: Monday 22 July 2019 8:55
by teemurama
Could someone advice me little..
What's wrong with this blocky ? No alarm on gateway also nothing in phone via Pushover too.
Pushover is working because I have garage door set via Pushover and it's ok.

Re: Security - blocky with Xiaomi gateway
Posted: Monday 22 July 2019 9:27
by waaren
teemurama wrote: ↑Monday 22 July 2019 8:55
What's wrong with this blocky ? No alarm on gateway also nothing in phone via Pushover too.
You used the wrong control block (the one you have is to be used for nested if else constructs)
Use this one

- Blockly; if-do (default).png (2.91 KiB) Viewed 1543 times
Re: Security - blocky with Xiaomi gateway
Posted: Monday 22 July 2019 9:39
by teemurama
Thanks for very fast answer! And that did the job, now it works! Thank you!
Re: Security - blocky with Xiaomi gateway
Posted: Tuesday 23 July 2019 11:00
by teemurama
Another question.. with blocky above gateway keeps about 10 sec alarm no 1min as I'd like to. What could help for this problem ?
Re: Security - blocky with Xiaomi gateway
Posted: Tuesday 23 July 2019 12:12
by waaren
teemurama wrote: ↑Tuesday 23 July 2019 11:00
Another question.. with blocky above gateway keeps about 10 sec alarm no 1min as I'd like to. What could help for this problem ?
This is a setting in the gateway itself. Only way to deal with this from domoticz is to give repeated On commands.
I would not know how to solve this using Blockly but in dzVents it would be like the script below.
When not yet familiar with dzVents please start with reading
Get started Before implementing. Special attention please for
"In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."
Code: Select all
return
{
on = {
devices = { 'Kuisti_liike', 'Porch movement' },
security = { domoticz.SECURITY_DISARMED },
},
execute = function(dz, item)
local alarm = dz.devices('Xiaomi Gateway Alarm Ringtone')
local gateway = dz.devices('Xiaomi RGB Gateway')
if item.active and dz.security == dz.SECURITY_ARMEDAWAY then
gateway.switchOn()
dz.devices('Xiaomi Gateway Volume').dimTo(20)
alarm.cancelQueuedCommands()
alarm.switchSelector(30)
for seconds = 0, 5 do
alarm.switchOn().afterSec(seconds * 10)
end
alarm.switchOff().afterSec(60)
elseif item.isSecurity then
alarm.cancelQueuedCommands()
alarm.switchOff()
gateway.switchOff()
end
end
}
Re: Security - blocky with Xiaomi gateway
Posted: Tuesday 23 July 2019 16:38
by teemurama
Cool, Thx very much!
Fast test and I think it works just like it should be. Need to test it again later today!
Re: Security - blocky with Xiaomi gateway
Posted: Saturday 03 August 2019 20:53
by teemurama
Works very nice!
But just realised that I'm not getting alert to my phone via Pushover. Could someone help with that ?
Also I need to setup same kind of code to garage door where is door/windows sensor.
Can I use same code, just change device name ?
Re: Security - blocky with Xiaomi gateway
Posted: Saturday 10 August 2019 13:10
by teemurama
Some Googling and testing and this solved notification problem,
dz.notify("HÄLYTYS ULKO-OVI","Ovihälytys",dz.PRIORITY_EMERGENCY,nil,nil,dz.NSS_PUSHOVER)