Page 1 of 1

Multiple devices in "on" part

Posted: Saturday 12 January 2019 19:30
by rizzah
Hi,

I used this line (which works):

Code: Select all

    on      =   {   devices = {["Overloop_Sensor"] = {"on mon,tue,wed,thu,fri,sat,sun"}},
Now i got a second sensor so i tried this:

Code: Select all

    on      =   {   devices = {["Overloop_Sensor" or "Overloop2_Sensor"] = {"on mon,tue,wed,thu,fri,sat,sun"}},
But i'm not sure if this is the correct way of doing it, could someone help me with this?

Regards,

Re: Multiple devices in "on" part

Posted: Saturday 12 January 2019 20:12
by waaren
rizzah wrote: Saturday 12 January 2019 19:30 Now i got a second sensor so i tried this:

Code: Select all

    on      =   {   devices = {["Overloop_Sensor" or "Overloop2_Sensor"] = {"on mon,tue,wed,thu,fri,sat,sun"}},
But i'm not sure if this is the correct way of doing it, could someone help me with this?
Try it like this.

Code: Select all

local timeTable = {'at 13:00-22:00 on sat','at 19:00-23:30 on mon,tue,wed,fri','at 19:00-02:30 on thu'}
return {
            on =    {  
                        devices =   { 
                                        ['Motion Kantine']           = timeTable,
                                        ['Status_Muziek']            = timeTable,
                                        ['Verlichting_Kantine_Mode'] = timeTable
                                    }
                    },

    logging =   {   level   =   domoticz.LOG_DEBUG,
                    marker  =   "helper"               },
     
    execute = function(dz, item)
        
        local function logWrite(str,level)
            dz.log(tostring(str),level or dz.LOG_DEBUG)
        end

        logWrite ("triggered by " .. item.name)
    end
}