Code: Select all
{
"ActTime" : 1516901014,
"AstrTwilightEnd" : "19:11",
"AstrTwilightStart" : "06:29",
"CivTwilightEnd" : "17:50",
"CivTwilightStart" : "07:50",
"DayLength" : "08:45",
"NautTwilightEnd" : "18:31",
"NautTwilightStart" : "07:09",
"ServerTime" : "2018-01-25 18:23:34",
"SunAtSouth" : "12:05",
"Sunrise" : "08:27",
"Sunset" : "17:13",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"CustomImage" : 0,
"Data" : "1 Lux",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 24,
"HardwareName" : "RaZberry",
"HardwareType" : "OpenZWave USB",
"HardwareTypeVal" : 21,
"HaveTimeout" : false,
"ID" : "0001003",
"LastUpdate" : "2018-01-25 16:47:59",
"Name" : "PIR Achterkamer Lux",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "Lux",
"Timers" : "false",
"Type" : "Lux",
"TypeImg" : "lux",
"Unit" : 255,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "417"
}
],
"status" : "OK",
"title" : "Devices"
}
Code: Select all
return {
active = true,
-- active = false,
on = {
devices = { 'PIR*' }
},
execute = function(domoticz, detector)
print( '<b style="color:Red">>> ' .. detector.switchType )
if detector.switchType == 'Motion Sensor' then
print('<b style="color:DarkOrange">>> ' .. detector.name .. ' - ' .. detector.state )
.......
end
end
}