- Files:
-
- 9 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
/tags/0.7/D_PowermaxPartition2.json
r20 r30 215 215 }, 216 216 "cmd_2": { 217 "label": "Set Partition Armed Home (With PIN)", 218 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", 219 "action": "RequestArmMode", 220 "arguments": { 221 "State": "Stay" 222 }, 223 "argumentList": { 224 "argument_1": { 225 "dataType": "string", 226 "defaultValue": "0000", 227 "prefix" : "PIN", 228 "suffix" : "0-9999, (insecure)", 229 "name": "PINCode" 230 } 231 } 232 }, 233 "cmd_3": { 234 "label": "Set Partition Armed Away (With PIN)", 235 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", 236 "action": "RequestArmMode", 237 "arguments": { 238 "State": "Armed" 239 }, 240 "argumentList": { 241 "argument_1": { 242 "dataType": "string", 243 "defaultValue": "0000", 244 "prefix" : "PIN", 245 "suffix" : "0-9999, (insecure)", 246 "name": "PINCode" 247 } 248 } 249 }, 250 "cmd_4": { 251 "label": "Set Partition Armed Home (No PIN)", 252 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", 253 "action": "RequestQuickArmMode", 254 "arguments": { 255 "State": "Stay" 256 } 257 }, 258 "cmd_5": { 217 259 "label": "Set Partition Armed Away (No PIN)", 218 260 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", … … 220 262 "arguments": { 221 263 "State": "Armed" 222 }223 },224 "cmd_3": {225 "label": "Set Partition Armed Home (No PIN)",226 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2",227 "action": "RequestQuickArmMode",228 "arguments": {229 "State": "Stay"230 264 } 231 265 } … … 260 294 "allowedValueList" : { 261 295 "Disarmed" : "Disarmed", 262 "Armed " : "Armed",263 " Stay" : "Stay"296 "ArmedHome" : "Stay", 297 "ArmedAway" : "Armed" 264 298 }, 265 299 "name": "DetailedArmMode", -
/tags/0.7/I_Powermax.xml
r20 r30 449 449 powermaxSendPDU() 450 450 elseif (state == "Stay") then 451 outgoingPDU = string.char(0x0D, 0xA1, 0x00, 0x00, 0x04) .. powermaxGetPin( ) .. string.char(0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x0A)451 outgoingPDU = string.char(0x0D, 0xA1, 0x00, 0x00, 0x04) .. powermaxGetPin(pin) .. string.char(0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x0A) 452 452 powermaxSendPDU() 453 453 else -
/trunk/D_PowermaxPartition2.json
r20 r30 39 39 "Control": [ 40 40 { 41 "ControlGroup":"2",42 41 "ControlType": "button", 43 42 "Label": { … … 182 181 "Height": 20 183 182 } 184 } 183 }, 184 { 185 "ControlType": "label", 186 "Label": { 187 "lang_tag": "memory", 188 "text": "Status Code: " 189 }, 190 "Display": { 191 "Top": 200, 192 "Left": 50, 193 "Width": 75, 194 "Height": 20 195 } 196 }, 197 { 198 "ControlType": "variable", 199 "Display": { 200 "Service": "urn:micasaverde-com:serviceId:AlarmPartition2", 201 "Variable": "VendorStatusCode", 202 "Top": 200, 203 "Left": 150, 204 "Width": 175, 205 "Height": 20 206 } 207 }, 208 { 209 "ControlType": "label", 210 "Label": { 211 "lang_tag": "memory", 212 "text": "Status Data: " 213 }, 214 "Display": { 215 "Top": 250, 216 "Left": 50, 217 "Width": 75, 218 "Height": 20 219 } 220 }, 221 { 222 "ControlType": "variable", 223 "Display": { 224 "Service": "urn:micasaverde-com:serviceId:AlarmPartition2", 225 "Variable": "VendorStatusData", 226 "Top": 250, 227 "Left": 150, 228 "Width": 175, 229 "Height": 20 230 } 231 } 185 232 ] 186 233 }, … … 199 246 "group_1": { 200 247 "cmd_1": { 201 "label": "Set Partition ... (PIN)",248 "label": "Set Partition Disarmed (With PIN)", 202 249 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", 203 250 "action": "RequestArmMode", 251 "arguments": { 252 "State": "Disarmed" 253 }, 204 254 "argumentList": { 205 255 "argument_1": { 206 256 "dataType": "string", 207 "defaultValue": "Disarmed", 208 "allowedValueList": { 209 "Disarmed" : "Disarmed", 210 "Armed" : "Armed", 211 "Stay" : "Stay" 212 }, 213 "name": "State", 214 "prefix": "State", 215 "suffix": "" 216 }, 217 "argument_2": { 257 "defaultValue": "0000", 258 "prefix" : "PIN", 259 "suffix" : "0-9999, (insecure)", 260 "name": "PINCode" 261 } 262 } 263 }, 264 "cmd_2": { 265 "label": "Set Partition Armed Home (With PIN)", 266 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", 267 "action": "RequestArmMode", 268 "arguments": { 269 "State": "Stay" 270 }, 271 "argumentList": { 272 "argument_1": { 218 273 "dataType": "string", 219 274 "defaultValue": "0000", 220 275 "prefix" : "PIN", 221 "suffix" : "0-9999 9999, (insecure)",276 "suffix" : "0-9999, (insecure)", 222 277 "name": "PINCode" 223 278 } 224 279 } 225 } 226 }, 227 "group_2": { 228 "cmd_1": { 280 }, 281 "cmd_3": { 282 "label": "Set Partition Armed Away (With PIN)", 283 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", 284 "action": "RequestArmMode", 285 "arguments": { 286 "State": "Armed" 287 }, 288 "argumentList": { 289 "argument_1": { 290 "dataType": "string", 291 "defaultValue": "0000", 292 "prefix" : "PIN", 293 "suffix" : "0-9999, (insecure)", 294 "name": "PINCode" 295 } 296 } 297 }, 298 "cmd_4": { 299 "label": "Set Partition Armed Home (No PIN)", 300 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", 301 "action": "RequestQuickArmMode", 302 "arguments": { 303 "State": "Stay" 304 } 305 }, 306 "cmd_5": { 229 307 "label": "Set Partition Armed Away (No PIN)", 230 308 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", … … 232 310 "arguments": { 233 311 "State": "Armed" 234 }235 },236 "cmd_2": {237 "label": "Set Partition Armed Home (No PIN)",238 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2",239 "action": "RequestQuickArmMode",240 "arguments": {241 "State": "Stay"242 312 } 243 313 } … … 272 342 "allowedValueList" : { 273 343 "Disarmed" : "Disarmed", 274 "Armed " : "Armed",275 " Stay" : "Stay"344 "ArmedHome" : "Stay", 345 "ArmedAway" : "Armed" 276 346 }, 277 347 "name": "DetailedArmMode", … … 283 353 }, 284 354 "event_3": { 285 "label": "Alarm Active",355 "label": "Alarm active", 286 356 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", 287 357 "argumentList" : { … … 299 369 } 300 370 } 371 }, 372 "event_4": { 373 "label": "Alarm detail", 374 "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition2", 375 "argumentList" : { 376 "argument_1" : { 377 "dataType": "string", 378 "defaultValue": "None", 379 "allowedValueList" : { 380 "Intruder" : "Intruder", 381 "Tamper" : "Tamper", 382 "Fire" : "Fire", 383 "Flood" : "Flood", 384 "Gas" : "Gas" 385 }, 386 "name": "VendorStatusData", 387 "comparisson": "=", 388 "prefix": "Alarm type", 389 "suffix": "" 390 } 391 } 301 392 } 302 393 }, -
/trunk/I_Powermax.xml
r20 r30 5 5 </settings> 6 6 <functions> 7 POWERMAX_VERSION = "V 0. 70"7 POWERMAX_VERSION = "V 0.81" 8 8 LOG_DEBUG = false 9 9 MotionOffDelay = 5 … … 19 19 PARTITION_SID = "urn:micasaverde-com:serviceId:AlarmPartition2" 20 20 SECURITY_SID = "urn:micasaverde-com:serviceId:SecuritySensor1" 21 21 SWITCH_SID = "urn:upnp-org:serviceId:SwitchPower1" 22 22 23 23 … … 50 50 "Zone 27", "Zone 28", "Zone 29", "Zone 30", "Fob 01", "Fob 02", "Fob 03", "Fob 04", "Fob 05", 51 51 "Fob 06", "Fob 07", "Fob 08", "User 01", "User 02", "User 03", "User 04", "User 05", "User 06", 52 "User 07", "User 08", "Pad 01", "Pad 02", "Pad 03", "Pad 04", "Pad 05", "Pad 06", "Pad 07", "Pad 08" } 52 "User 07", "User 08", "Pad 01", "Pad 02", "Pad 03", "Pad 04", "Pad 05", "Pad 06", "Pad 07", "Pad 08", 53 "Sir 01", "Sir 02", "2Pad 01", "2Pad 02", "2Pad 03", "2Pad 04", "X10 01", "X10 02", "X10 03", "X10 04", 54 "X10 05", "X10 06", "X10 07", "X10 08", "X10 09", "X10 10", "X10 11", "X10 12", "X10 13", "X10 14", 55 "X10 15", "PGM ", "GSM ", "P-LINK ", "PTag 01", "PTag 02", "PTag 03", "PTag 04", "PTag 05", "PTag 06", 56 "PTag 07", "PTag 08" } 53 57 54 58 sysStatusStr = { "Disarmed", "Exit Delay", "Exit Delay", "Entry Delay", "Armed Home", "Armed Away", "User Test", … … 188 192 end 189 193 end 194 luup.task('Adding X10 devices ',4,'Powermax',-1) 195 for i=1,15 do 196 s=string.format("X%02d", i) 197 if( string.find (luup.devices[panel_device].id,s)~=nil ) then 198 luup.log("POWERMAX: adding X10 device " .. s, 10) 199 luup.chdev.append(panel_device,child_devices,s,s.." (Powermax)","urn:schemas-upnp-org:device:BinaryLight:1","D_BinaryLight1.xml","","",false) 200 end 201 end 202 luup.task('Adding PGM output ',4,'Powermax',-1) 203 if( string.find (luup.devices[panel_device].id,"PGM")~=nil ) then 204 luup.log("POWERMAX: adding PGM output", 10) 205 luup.chdev.append(panel_device,child_devices,"PGM","PGM (Powermax)","urn:schemas-micasaverde-com:device:MotionSensor:1","D_MotionSensor1.xml","","",false) 206 end 190 207 luup.chdev.sync(panel_device,child_devices) 191 208 luup.call_timer("motionOff", 1, "1m", "", "") … … 194 211 end 195 212 213 196 214 -- switch to armed home 197 215 function powermaxGoArmedHome() 198 216 local detailedArmModeNum = luup.variable_get(PARTITION_SID, "DetailedArmModeNum", partition_device) 217 detailedArmModeNum = tonumber(detailedArmModeNum) 199 218 if ((detailedArmModeNum ~= 1) or (detailedArmModeNum == nil)) then 200 219 luup.variable_set(PARTITION_SID, "DetailedArmModeNum", 1, partition_device) … … 208 227 function powermaxGoArmedAway() 209 228 local detailedArmModeNum = luup.variable_get(PARTITION_SID, "DetailedArmModeNum", partition_device) 229 detailedArmModeNum = tonumber(detailedArmModeNum) 210 230 if ((detailedArmModeNum ~= 2) or (detailedArmModeNum == nil)) then 211 231 luup.variable_set(PARTITION_SID, "DetailedArmModeNum", 2, partition_device) … … 219 239 function powermaxGoDisarmed() 220 240 local detailedArmModeNum = luup.variable_get(PARTITION_SID, "DetailedArmModeNum", partition_device) 241 detailedArmModeNum = tonumber(detailedArmModeNum) 221 242 if ((detailedArmModeNum ~= 0) or (detailedArmModeNum == nil)) then 222 243 luup.variable_set(PARTITION_SID, "DetailedArmModeNum", 0, partition_device) … … 297 318 local eventZone = string.byte(string.sub(incomingPDU, 7, 7)) 298 319 local eventType = string.byte(string.sub(incomingPDU, 8, 8)) 299 320 local x10Stat1 = string.byte(string.sub(incomingPDU, 11, 11)) 321 local x10Stat2 = string.byte(string.sub(incomingPDU, 12, 12)) 322 300 323 if (eventType~=0x00) then 301 324 debug(string.format("POWERMAX: Event %s in Zone %02d",eventTypeStr[eventType+1], eventZone)) … … 306 329 if (eventType==0x03) then 307 330 luup.variable_set(SECURITY_SID, "Tripped", 1, child) 308 luup.variable_set(SECURITY_SID, "LastTrip", os.time(), child) 331 luup.variable_set(SECURITY_SID, "LastTrip", os.time(), child) 309 332 end 310 333 if (eventType==0x04) then … … 322 345 end 323 346 347 bitw = require("bit") 348 349 local child = findChild(panel_device, string.format("PGM")) 350 if (child ~= nil) then 351 if (bitw.band( x10Stat1, 1)==1) then 352 luup.variable_set(SECURITY_SID, "Tripped", 1, child) 353 luup.variable_set(SECURITY_SID, "LastTrip", os.time(), child) 354 else 355 luup.variable_set(SECURITY_SID, "Tripped", 0, child) 356 end 357 end 358 359 for i=1,7 do 360 child = findChild(panel_device, string.format("X%02d", i)) 361 if (child ~= nil) then 362 if (bitw.band( x10Stat1, (2^i))==(2^i)) then 363 luup.variable_set(SWITCH_SID, "Status", 1, child) 364 else 365 luup.variable_set(SWITCH_SID, "Status", 0, child) 366 end 367 end 368 end 369 370 for i=0,7 do 371 child = findChild(panel_device, string.format("X%02d", (8+i))) 372 if (child ~= nil) then 373 if (bitw.band( x10Stat2, (2^i))==(2^i)) then 374 luup.variable_set(SWITCH_SID, "Status", 1, child) 375 else 376 luup.variable_set(SWITCH_SID, "Status", 0, child) 377 end 378 end 379 end 380 381 324 382 if (sysStatus==0x00) then powermaxGoDisarmed() end 325 383 if (sysStatus==0x04) then powermaxGoArmedHome() end 326 384 if (sysStatus==0x05) then powermaxGoArmedAway() end 327 385 328 bitw = require("bit")329 386 local sysFlagsStr = " " 330 if (bitw.band( sysFlags, 1)==0) then sysFlagsStr = sysFlagsStr .. ",NRDY" end 331 if (bitw.band( sysFlags, 2)==2) then sysFlagsStr = sysFlagsStr .. ",ALRM" end 332 if (bitw.band( sysFlags, 4)==4) then sysFlagsStr = sysFlagsStr .. ",TRBL" end 387 if (bitw.band( sysFlags, 1)==0) then 388 sysFlagsStr = sysFlagsStr .. ",NRDY" 389 end 390 if (bitw.band( sysFlags, 2)==2) then 391 sysFlagsStr = sysFlagsStr .. ",MEM" 392 if(luup.variable_get(PARTITION_SID, "AlarmMemory", partition_device)~=1) then 393 luup.variable_set(PARTITION_SID, "AlarmMemory", 1, partition_device) 394 end 395 else 396 if(luup.variable_get(PARTITION_SID, "AlarmMemory", partition_device)~=0) then 397 luup.variable_set(PARTITION_SID, "AlarmMemory", 0, partition_device) 398 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x00", partition_device) 399 luup.variable_set(PARTITION_SID, "VendorStatusData", "None", partition_device) 400 end 401 end 402 if (bitw.band( sysFlags, 4)==4) then 403 sysFlagsStr = sysFlagsStr .. ",TRBL" 404 end 405 if (bitw.band( sysFlags, 8)==128) then 406 sysFlagsStr = sysFlagsStr .. ",ALRM" 407 if(luup.variable_get(PARTITION_SID, "Alarm", partition_device)~="Active") then 408 luup.variable_set(PARTITION_SID, "Alarm", "Active", partition_device) 409 end 410 else 411 if(luup.variable_get(PARTITION_SID, "Alarm", partition_device)~="None") then 412 luup.variable_set(PARTITION_SID, "Alarm", "None", partition_device) 413 end 414 end 333 415 debug(string.format("POWERMAX: System state is %s %s",(sysStatusStr[sysStatus+1] or "UNKNOWN"), sysFlagsStr)) 334 416 luup.variable_set(PARTITION_SID, "VendorStatus", (sysStatusStr[sysStatus+1] or "UNKNOWN") .. sysFlagsStr, partition_device) … … 337 419 end 338 420 if (string.byte(string.sub(incomingPDU, 2, 2))==0xA7) then 339 local logEvent = string.byte(string.sub(incomingPDU, 6, 6)) 340 debug(string.format("POWERMAX: System message %s", (logEventStr[logEvent+1] or "UNKNOWN"))) 421 local eventZone = string.byte(string.sub(incomingPDU, 5, 5)) 422 local logEvent = string.byte(string.sub(incomingPDU, 6, 6)) 423 debug(string.format("POWERMAX: System message %s", (logEventStr[logEvent+1] or "UNKNOWN"))) 424 if (logEvent==0x01) then 425 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x01", partition_device) 426 luup.variable_set(PARTITION_SID, "VendorStatusData", "Intruder", partition_device) 427 elseif (logEvent==0x02) then 428 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x02", partition_device) 429 luup.variable_set(PARTITION_SID, "VendorStatusData", "Intruder", partition_device) 430 elseif (logEvent==0x03) then 431 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x03", partition_device) 432 luup.variable_set(PARTITION_SID, "VendorStatusData", "Intruder", partition_device) 433 elseif (logEvent==0x04) then 434 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x04", partition_device) 435 luup.variable_set(PARTITION_SID, "VendorStatusData", "Intruder", partition_device) 436 elseif (logEvent==0x05) then 437 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x05", partition_device) 438 luup.variable_set(PARTITION_SID, "VendorStatusData", "Intruder", partition_device) 439 elseif (logEvent==0x06) then 440 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x06", partition_device) 441 luup.variable_set(PARTITION_SID, "VendorStatusData", "Tamper", partition_device) 442 elseif (logEvent==0x07) then 443 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x07", partition_device) 444 luup.variable_set(PARTITION_SID, "VendorStatusData", "Tamper", partition_device) 445 elseif (logEvent==0x08) then 446 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x08", partition_device) 447 luup.variable_set(PARTITION_SID, "VendorStatusData", "Tamper", partition_device) 448 elseif (logEvent==0x09) then 449 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x09", partition_device) 450 luup.variable_set(PARTITION_SID, "VendorStatusData", "Tamper", partition_device) 451 elseif (logEvent==0x20) then 452 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x20", partition_device) 453 luup.variable_set(PARTITION_SID, "VendorStatusData", "Fire", partition_device) 454 elseif (logEvent==0x4D) then 455 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x4D", partition_device) 456 luup.variable_set(PARTITION_SID, "VendorStatusData", "Flood", partition_device) 457 elseif (logEvent==0x49) then 458 luup.variable_set(PARTITION_SID, "VendorStatusCode", "0x49", partition_device) 459 luup.variable_set(PARTITION_SID, "VendorStatusData", "Gas", partition_device) 460 elseif (logEvent==0x21) then 461 debug(string.format("POWERMAX: Fire restore in Zone %02d", eventZone)) 462 local child = findChild(panel_device, string.format("Z%02d", eventZone)) 463 if (child == nil) then 464 debug(string.format("POWERMAX: unable to locate zone device %02d", eventZone)) 465 else 466 luup.variable_set(SECURITY_SID, "Tripped", 0, child) 467 end 468 elseif (logEvent==0x4A) then 469 debug(string.format("POWERMAX: Gas restore in Zone %02d", eventZone)) 470 local child = findChild(panel_device, string.format("Z%02d", eventZone)) 471 if (child == nil) then 472 debug(string.format("POWERMAX: unable to locate zone device %02d", eventZone)) 473 else 474 luup.variable_set(SECURITY_SID, "Tripped", 0, child) 475 end 476 elseif (logEvent==0x4E) then 477 debug(string.format("POWERMAX: Flood restore in Zone %02d", eventZone)) 478 local child = findChild(panel_device, string.format("Z%02d", eventZone)) 479 if (child == nil) then 480 debug(string.format("POWERMAX: unable to locate zone device %02d", eventZone)) 481 else 482 luup.variable_set(SECURITY_SID, "Tripped", 0, child) 483 end 484 end 341 485 return true 342 486 end … … 449 593 powermaxSendPDU() 450 594 elseif (state == "Stay") then 451 outgoingPDU = string.char(0x0D, 0xA1, 0x00, 0x00, 0x04) .. powermaxGetPin( ) .. string.char(0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x0A)595 outgoingPDU = string.char(0x0D, 0xA1, 0x00, 0x00, 0x04) .. powermaxGetPin(pin) .. string.char(0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x0A) 452 596 powermaxSendPDU() 453 597 else … … 476 620 </run> 477 621 </action> 478 479 622 <action> 480 623 <serviceId>urn:micasaverde-com:serviceId:SecuritySensor1</serviceId> … … 482 625 <run> 483 626 luup.variable_set(SECURITY_SID, "Armed", lul_settings.newArmedValue, lul_device) 627 </run> 628 </action> 629 <action> 630 <serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId> 631 <name>SetTarget</name> 632 <run> 633 local x10PDU = string.char(0x00, 0x00) 634 --luup.variable_set(SWITCH_SID, "Status", lul_settings.newTargetValue, lul_device) 635 if (luup.devices[lul_device].id == "X01") then x10PDU = string.char(0x02, 0x00) end 636 if (luup.devices[lul_device].id == "X02") then x10PDU = string.char(0x04, 0x00) end 637 if (luup.devices[lul_device].id == "X03") then x10PDU = string.char(0x08, 0x00) end 638 if (luup.devices[lul_device].id == "X04") then x10PDU = string.char(0x10, 0x00) end 639 if (luup.devices[lul_device].id == "X05") then x10PDU = string.char(0x20, 0x00) end 640 if (luup.devices[lul_device].id == "X06") then x10PDU = string.char(0x40, 0x00) end 641 if (luup.devices[lul_device].id == "X07") then x10PDU = string.char(0x80, 0x00) end 642 if (luup.devices[lul_device].id == "X08") then x10PDU = string.char(0x00, 0x01) end 643 if (luup.devices[lul_device].id == "X09") then x10PDU = string.char(0x00, 0x02) end 644 if (luup.devices[lul_device].id == "X10") then x10PDU = string.char(0x00, 0x04) end 645 if (luup.devices[lul_device].id == "X11") then x10PDU = string.char(0x00, 0x08) end 646 if (luup.devices[lul_device].id == "X12") then x10PDU = string.char(0x00, 0x10) end 647 if (luup.devices[lul_device].id == "X13") then x10PDU = string.char(0x00, 0x20) end 648 if (luup.devices[lul_device].id == "X14") then x10PDU = string.char(0x00, 0x40) end 649 if (luup.devices[lul_device].id == "X15") then x10PDU = string.char(0x00, 0x80) end 650 outgoingPDU = string.char(0x0D, 0xA4, 0x00, 0x00, 0x00, 0x00, 0x00) .. string.char(tonumber(lul_settings.newTargetValue)) .. x10PDU .. string.char(0x00, 0x00, 0x43, 0x00, 0x0A) 651 powermaxSendPDU() 484 652 </run> 485 653 </action> … … 495 663 </run> 496 664 </action> 665 <action> 666 <serviceId>urn:micasaverde-com:serviceId:PowermaxAlarmPanel1</serviceId> 667 <name>SyncTime</name> 668 <run> 669 luup.log(string.format("POWERMAX: SyncTime"), 10) 670 local t = os.date('*t') 671 t.year=t.year - 2000 672 -- This works only on some powermax devices 673 outgoingPDU = string.char(0x0D, 0x46, 0xF8, 0x00, 0x00) .. string.char(t.min, t.hour, t.day, t.month, t.year) .. string.char(0xFF, 0xFF, 0x00, 0x0A) 674 powermaxSendPDU() 675 </run> 676 </action> 497 677 </actionList> 498 678 </implementation> -
/trunk/D_Powermax.json
r20 r30 27 27 "id":"1", 28 28 "type":"info" 29 } 29 } 30 30 ], 31 31 "Control": [ … … 39 39 }, 40 40 "Display": { 41 "Top": 150,41 "Top": 50, 42 42 "Left": 50, 43 43 "Width": 75, … … 52 52 "Service": "urn:micasaverde-com:serviceId:PowermaxAlarmPanel1", 53 53 "Variable": "PowermaxVersion", 54 "Top": 150,54 "Top": 50, 55 55 "Left": 150, 56 56 "Width": 175, 57 57 "Height": 20 58 58 } 59 } 59 }, 60 { 61 "ControlType": "button", 62 "Label": { 63 "lang_tag": "synctime", 64 "text": "Sync Time on Powermax and Vera" 65 }, 66 "Display": { 67 "Top": 100, 68 "Left": 50, 69 "Width": 325, 70 "Height": 20 71 }, 72 "Command": { 73 "Service": "urn:micasaverde-com:serviceId:PowermaxAlarmPanel1", 74 "Action": "SyncTime" 75 } 76 }, 60 77 ] 61 78 }, … … 96 113 } 97 114 } 98 } 115 }, 116 "cmd_2": { 117 "label": "SyncTime", 118 "serviceId": "urn:micasaverde-com:serviceId:PowermaxAlarmPanel1", 119 "action": "SyncTime", 120 "argumentList": { 121 } 122 }, 99 123 } 100 124 }, -
/trunk/S_Powermax.xml
r20 r30 16 16 </argumentList> 17 17 </action> 18 <action> 19 <name>SyncTime</name> 20 </action> 18 21 </actionList> 19 22 </scpd> -
/trunk/J_Powermax.js
r20 r30 7 7 html += '<table align=center>'; 8 8 html += '<tr><td><input id="eventLogButton" type="button" value="Update Event Log" onclick="getEventLog('+device+');">'; 9 html += ' PIN: <input type="password" name="pinTextArea" id="pinTextArea"></td></tr>';9 html += ' Access Code: <input type="password" name="pinTextArea" id="pinTextArea"></td></tr>'; 10 10 html += '<tr><td><textarea readonly="yes" cols="70" rows="20" id="eventLogTextArea"></textarea></td></tr>'; 11 11 html += '</table>';
Note: See TracChangeset
for help on using the changeset viewer.