Page 1 of 1

sValues vs Current state - Satel Integra

Posted: Sunday 13 August 2017 18:07
by petecz
I am trying to configure notifications via Pushover for alarm events.
I can only configure notifications for 'Current state' values, not for 'sValues'. What's the difference?
Why there is no 'current state' for few outputs?
How to handle it?

Re: sValues vs Current state - Satel Integra

Posted: Tuesday 15 August 2017 10:21
by petecz
Or I need other ideas for configuring notifications.... Only 'Arm partition' works at the moment.
Why 'text device' hasn't any current state, how to rewrite it from sValue?

Re: sValues vs Current state - Satel Integra

Posted: Wednesday 16 August 2017 17:58
by mivo
Hi,

not everything works in Blockly. This should work in dzVents scripting:

Code: Select all

return {
    active = true,
    logging = {
        level = domoticz.LOG_INFO,
    },
    on = {
        -- trigger on device with name
        devices = {'Text device'}
    },

    execute = function(domoticz, device)
        -- check text value of device
        if device.text == 'ON' then
                -- log for debugging purpose
                domoticz.log('Text is ON')
                -- send notification, more parameters available - see Wiki
                domoticz.notify('Text is ON')
        end
   end
}
Complete syntax of domoticz.notify() function is on Wiki: https://www.domoticz.com/wiki/DzVents:_ ... object_API:

Re: sValues vs Current state - Satel Integra

Posted: Thursday 17 August 2017 8:21
by petecz
hey it works thanks!
Two questions:
1) how to make else construction in dzVents
/something like

Code: Select all

return {
    active = true,
    logging = {
        level = domoticz.LOG_INFO,
    },
    on = {
        -- trigger on device with name
        devices = {'Brak zasilania'}
    },

    execute = function(domoticz, device)
        -- check text value of device
        if device.text == 'On' then
                -- log for debugging purpose
                domoticz.log('Brak zasilania')
                -- send notification, more parameters available - see Wiki
                domoticz.notify('Brak zasilania')
        else device.text == 'Off' then
                -- log for debugging purpose
                domoticz.log('Powrot zasilania')
                -- send notification, more parameters available - see Wiki
                domoticz.notify('Powrot zasilania')
        end
   end
}
but it doesn't work

2) Why Pushover is not working, despite the sending is done is logs? /email sending works ok/

Re: sValues vs Current state - Satel Integra

Posted: Thursday 17 August 2017 8:39
by mivo
Change else to this - normal LUA syntax, nothing specific to dzVents:

Code: Select all

elseif device.text == 'Off' then
I have no experience with Pushover - do you set it in Setup / Settings / Notifications ? Does it send message when click on Test ?

Re: sValues vs Current state - Satel Integra

Posted: Thursday 17 August 2017 9:57
by petecz
mivo wrote: Thursday 17 August 2017 8:39 Change else to this - normal LUA syntax, nothing specific to dzVents:

Code: Select all

elseif device.text == 'Off' then
I have no experience with Pushover - do you set it in Setup / Settings / Notifications ? Does it send message when click on Test ?
Ok, priority must be set as default level is no notification on smartphone ;)

Code: Select all

domoticz.notify('Brak zasilania','Informacja z systemu alarmowego',domoticz.PRIORITY_NORMAL)
should be elseif additionally ended as I've got parse errors?

Re: sValues vs Current state - Satel Integra

Posted: Thursday 17 August 2017 10:28
by mivo
IF..ELSEIF should be enclosed by "end" - complete condition part of your original script should be:

Code: Select all

...
        -- check text value of device
        if device.text == 'On' then
                -- log for debugging purpose
                domoticz.log('Brak zasilania')
                -- send notification, more parameters available - see Wiki
                domoticz.notify('Brak zasilania')
        elseif device.text == 'Off' then
                -- log for debugging purpose
                domoticz.log('Powrot zasilania')
                -- send notification, more parameters available - see Wiki
                domoticz.notify('Powrot zasilania')
        end

Re: sValues vs Current state - Satel Integra

Posted: Monday 16 October 2017 19:55
by fantom
Hi.
Please write post about Satel Integra in this task: viewtopic.php?f=17&t=4260
I'm author of this module, and sometimes I may help

Fantom