Patrick, it does not need to be exactly 1 sec, it could be 1/2 a sec or even .94875 of a second. Just pause between commands.
Hi creed, you sound like me, zwave, insteon and x-10. I can not answer your question on x10 dimming, do not use it. I use x10 for 2 things. One turn on whole house fan, soon to be zwave. the second is to turn on high power amps for home theater. I use commercial amps not consumer amps so they do not have a âsenseâ like consumer stuff does, they are either on or off. So i leave the switch on and use an x10 appliance controller.
Here is a copy of the code so far for the x-10 control, remember does not work⌠just yet!
/**
*Insteon Switch X-10 edit (LOCAL) Added line 51(29), changed line 50(28), changed line 84(61), changed line 113(90). editnewline(oldlineoriginalcode)
*
- Unit Code Value House Code Value Command Value
-
1 600 A 6 On 280
-
2 E00 B E Off 380
-
3 200 C 2 Bright 580
-
4 A00 D A Dim 480
-
5 100 E 1 All On 180
-
6 900 F 9 All Off 680
-
7 500 G 5
-
8 D00 H D
-
9 700 I 7
-
10 F00 J F
-
11 300 K 3
-
12 B00 L B
-
13 000 M 0
-
14 800 N 8
-
15 400 O 4
-
16 C00 P C
- Source:http://www.leftovercode.info/smartlinc_x10.html
-
*/
metadata {
definition (name: âInsteon Switch X-10 edit(LOCAL)â, namespace: âmichaelgoldâ, author: "patrick@patrickstuart.com/tslagle13@gmail.com/goldmichael@gmail.com") {
capability "Switch"
capability "Sensor"
capability âActuatorâ
}
preferences {
input("InsteonIP", "string", title:"Insteon IP Address", description: "Please enter your Insteon Hub IP Address", defaultValue: "192.168.1.2", required: true, displayDuringSetup: true)
input("InsteonPort", "string", title:"Insteon Port", description: "Please enter your Insteon Hub Port", defaultValue: 25105, required: true, displayDuringSetup: true)
input("InsteonID", "string", title:"Device Insteon ID", description: "Please enter the devices X-10 - numbers only", defaultValue: "660", required: true, displayDuringSetup: true)
input("HouseCode", "string", title:"X-10 House Code", description: "Please enter X-10 house code- numbers only", defaultValue: "6", required: true, displayDuringSetup: true)
input("InsteonHubUsername", "string", title:"Insteon Hub Username", description: "Please enter your Insteon Hub Username", defaultValue: "michael" , required: true, displayDuringSetup: true)
input("InsteonHubPassword", "string", title:"Insteon Hub Password", description: "Please enter your Insteon Hub Password", defaultValue: "password" , required: true, displayDuringSetup: true)
}
simulator {
// status messages
status "on": "on/off: 1"
status "off": "on/off: 0"
// reply messages
reply "zcl on-off on": "on/off: 1"
reply "zcl on-off off": "on/off: 0"
}
// UI tile definitions
tiles {
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {
state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821"
}
main "switch"
details "switch"
}
}
// handle commands
def on() {
//log.debug "Executing âtakeâ"
sendEvent(name: âswitchâ, value: âonâ)
def host = InsteonIP
def path = "http://" + "${InsteonIP}" + "/3?0263" + "${HouseCode}" + "${InsteonID}" + "=I=3" + " http://" + "${InsteonIP}" + "/3?0263" + "${HouseCode}" + "280" + "=I=3"
log.debug "path is: $path"
def userpassascii = "${InsteonHubUsername}:${InsteonHubPassword}"
def userpass = "Basic " + userpassascii.encodeAsBase64().toString()
def headers = [:] //"HOST:"
headers.put("HOST", "$host:$InsteonPort")
headers.put("Authorization", userpass)
try {
def hubAction = new physicalgraph.device.HubAction(
method: method,
path: path,
headers: headers
)
}
catch (Exception e) {
log.debug "Hit Exception on $hubAction"
log.debug e
}
}
def off() {
//log.debug "Executing âtakeâ"
sendEvent(name: âswitchâ, value: âoffâ)
def host = InsteonIP
def path = "http://" + "${InsteonIP}" + "/3?0263" + "${HouseCode}" + "${InsteonID}" + "=I=3" + " http://" + "${InsteonIP}" + "/3?0263" + "${HouseCode}" + "380" + "=I=3"
log.debug "path is: $path"
def userpassascii = "${InsteonHubUsername}:${InsteonHubPassword}"
def userpass = "Basic " + userpassascii.encodeAsBase64().toString()
def headers = [:] //"HOST:"
headers.put("HOST", "$host:$InsteonPort")
headers.put("Authorization", userpass)
try {
def hubAction = new physicalgraph.device.HubAction(
method: method,
path: path,
headers: headers
)
}
catch (Exception e) {
log.debug "Hit Exception on $hubAction"
log.debug e
}
}