instnAddr = indigo.devices["SynchroLinc Device Name"].address
######################
# Read out and log the current values:
reply = indigo.insteon.sendRawExtended(instnAddr, [0x2E, 0x00], waitForExtendedReply=True)
triggerWatts = (reply.replyBytes[4] * 256 + reply.replyBytes[5]) / 2.0
thresholdWatts = reply.replyBytes[7] / 2.0
delaySeconds = reply.replyBytes[6] / 6.6666
indigo.server.log("OLD:")
indigo.server.log(" full reply: " + str(reply.replyBytes))
indigo.server.log(" triggerWatts watts: %.1f" % (triggerWatts,))
indigo.server.log(" threadhold watts: %.1f" % (thresholdWatts,))
indigo.server.log(" delaySeconds watts: %.2f" % (delaySeconds,))
######################
# Change the trigger, threshold and delay values here. Use whatever
# values you think will work, but I woudln't set thresholdWatts below
# 1.5 watts and it should probably be a fraction of whatever triggerWatts is.
triggerWatts = 18.5 # default 14.5 -- I think
thresholdWatts = 2.5 # default 4.0 -- I think
delaySeconds = 6.45 # default 4.50 -- I think
setSyncroSettingsCmd = [
0x2E, 0x00,
0x00, # unused
0x02, # change settings
int(2 * triggerWatts / 256) & 0xFF,
int(2 * triggerWatts) & 0xFF,
int(round(6.6666 * delaySeconds)),
int(2 * thresholdWatts) & 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
]
indigo.insteon.sendRawExtended(instnAddr, setSyncroSettingsCmd)
######################
# Read out and log the new values (just for debugging)
reply = indigo.insteon.sendRawExtended(instnAddr, [0x2E, 0x00], waitForExtendedReply=True)
triggerWatts = (reply.replyBytes[4] * 256 + reply.replyBytes[5]) / 2.0
thresholdWatts = reply.replyBytes[7] / 2.0
delaySeconds = reply.replyBytes[6] / 6.6666
indigo.server.log("NEW:")
indigo.server.log(" full reply: " + str(reply.replyBytes))
indigo.server.log(" triggerWatts watts: %.1f" % (triggerWatts,))
indigo.server.log(" threadhold watts: %.1f" % (thresholdWatts,))
indigo.server.log(" delaySeconds watts: %.2f" % (delaySeconds,))
Dewster35 wrote:Gotcha...so should I be getting the Imeter instead of the synchrolinc? I get that it doesn't have an on/off limit functionality like synchrolinc....but can you do the same types of things with indigo and scripting?
Users browsing this forum: No registered users and 3 guests