dzvents Lua : commandArray['Switch'] does not work'

Post Reply
gerardosamara
Posts: 33
Joined: Sunday 23 October 2016 19:49
Target OS: Raspberry Pi
Domoticz version: 3.8153
Contact:

dzvents Lua : commandArray['Switch'] does not work'

Post by gerardosamara » Friday 18 August 2017 23:55

Hi ,

RPI3 + Domoticz version stable 3.8153

I created a simple Lua script , using the integrated editor of dzvents , to send a command On/Off to a zwave switch (DSC24 Aetec) from a selector switch called "House Mode" with status Disarm , Home , Away, Night as per the "Disarm" part below

commandArray = {}
if (devicechanged['House Mode'] == 'Disarm') then
print('House Mode : Setting Disarm')
commandArray['DSC24 Switch']='Off'
commandArray['SendNotification']='House Mode = #Disarm#0'
commandArray['SendEmail']='House Mode = #Disarm#[email protected]xxxxxl.com'
print('Disarm set')
end


When pressing on the "Disarm" button , the script is executed as I can see the print in the log , I received the email and the notification but the DSC24 smart switch does not go to off.

The switch name in the script matches the device name in device tab.
No debug messages in the Zwave log

I am unable to find the issue .

Please advice
Thank you
Domoticz RPi3 V3.8153 + App Android Domoticz Lite V0.1.408 & Imperihome Pro V2.8.4
Zwave+ Z Stick Z90 USB dongle + USB300 Ocean GW dongle + Arduino Serial GW
Smart witch Aeotec DSC24 Gen2

tlpeter
Posts: 391
Joined: Wednesday 26 November 2014 19:43
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: dzvents Lua : commandArray['Switch'] does not work'

Post by tlpeter » Saturday 19 August 2017 8:48

commandArray is not used anymore.
Read this wiki and use the examples for this:

http://www.domoticz.com/wiki/DzVents:_n ... _scripting

Nautilus
Posts: 653
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: dzvents Lua : commandArray['Switch'] does not work'

Post by Nautilus » Sunday 20 August 2017 12:22

You can of course still use the normal Lua scripts (not dZvents) with the kind of syntax as in your example. For dZvents there is a different kind of syntax altogether, more info on the previous post's link...

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests