Security - blocky with Xiaomi gateway

Moderator: leecollings

Post Reply
teemurama
Posts: 12
Joined: Saturday 09 June 2018 19:40
Target OS: Linux
Domoticz version:
Contact:

Security - blocky with Xiaomi gateway

Post 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.

Image
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Security - blocky with Xiaomi gateway

Post 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
Blockly; if-do (default).png (2.91 KiB) Viewed 1536 times
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
teemurama
Posts: 12
Joined: Saturday 09 June 2018 19:40
Target OS: Linux
Domoticz version:
Contact:

Re: Security - blocky with Xiaomi gateway

Post by teemurama »

Thanks for very fast answer! And that did the job, now it works! Thank you!
teemurama
Posts: 12
Joined: Saturday 09 June 2018 19:40
Target OS: Linux
Domoticz version:
Contact:

Re: Security - blocky with Xiaomi gateway

Post 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 ?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Security - blocky with Xiaomi gateway

Post 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
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
teemurama
Posts: 12
Joined: Saturday 09 June 2018 19:40
Target OS: Linux
Domoticz version:
Contact:

Re: Security - blocky with Xiaomi gateway

Post 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!
teemurama
Posts: 12
Joined: Saturday 09 June 2018 19:40
Target OS: Linux
Domoticz version:
Contact:

Re: Security - blocky with Xiaomi gateway

Post 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 ?
teemurama
Posts: 12
Joined: Saturday 09 June 2018 19:40
Target OS: Linux
Domoticz version:
Contact:

Re: Security - blocky with Xiaomi gateway

Post 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)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest