Search found 5 matches

by shketiev
Saturday 25 July 2020 15:36
Forum: LUA
Topic: One script to match multiple devices
Replies: 8
Views: 1056

Re: One script to match multiple devices

Just wondering , how can I add some limiting option for example:

If button is pressed , send notification , but once a minute , or every X time.
Now when someone press the button multiple times , it floods the system :(

Thanks !
by shketiev
Tuesday 16 June 2020 12:33
Forum: LUA
Topic: One script to match multiple devices
Replies: 8
Views: 1056

Re: One script to match multiple devices

Error: EventSystem: in PANIC Button: [string "commandArray = {} ..."]:2: bad argument #1 to 'pairs' (table expected, got nil) I don't why this error appears (every 60 seconds), but the script actually works and notifications is received correctly. You should save the Lua script as triggered on ...
by shketiev
Tuesday 16 June 2020 11:08
Forum: LUA
Topic: One script to match multiple devices
Replies: 8
Views: 1056

Re: One script to match multiple devices

I noticed that , and I actually see that I have posted previous error. After I remove ] after PANIC ' the error is on line 2. Error: EventSystem: in PANIC Button: [string "commandArray = {} ..."]:2: bad argument #1 to 'pairs' (table expected, got nil) I don't why this error appears (every 60 seconds ...
by shketiev
Monday 15 June 2020 13:49
Forum: LUA
Topic: One script to match multiple devices
Replies: 8
Views: 1056

Re: One script to match multiple devices

Something like this?: commandArray = {} for dev, status in pairs(devicechanged) do -- Check Panicbutton pressed if (dev:sub(1, 6) == 'PANIC '] and status == 'Closed') then commandArray['SendNotification']= dev ..' button pressed' end end return commandArray Jos Thank you very much ! Yes , exactly ...
by shketiev
Monday 15 June 2020 12:45
Forum: LUA
Topic: One script to match multiple devices
Replies: 8
Views: 1056

One script to match multiple devices

Hello, I have about 200 panic buttons connected to my domoticz with mysensors gateways. These are push buttons , but I added every button as a door contact , because of automatic release. I want to send notification when button is pressed and I can make it from notification section of every single ...