Changeset c9395f4
- Timestamp:
- 2014-07-24 20:35:53 (11 years ago)
- Branches:
- master
- Children:
- 2d69e31
- Parents:
- 56b5988
- git-author:
- purdueguy <purdueguy@…> (2014-07-24 20:35:53)
- git-committer:
- purdueguy <purdueguy@…> (2014-07-24 20:35:53)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified Main/L_ISYController1.lua ¶
r6fa25bb rc9395f4 168 168 ['8'] = true 169 169 }, 170 motionSensor = { 171 ['33'] = true 172 }, 170 173 } 171 174 … … 917 920 end 918 921 922 -- Motion Sensor 923 elseif (zwaveDeviceCategory4.motionSensor[subCat]) then 924 debugLog("MotionSensor: node " .. node .. " action: " .. action) 925 local deviceId = getChild(nodeParent) 926 local result = nil 927 928 -- We only care about status changes 929 if (command == "ST") then 930 -- secure (not tripped) 931 if (action == "0") then 932 result = setIfChanged(SENSOR_SERVICEID, 'Tripped', 0, deviceId) 933 934 -- tripped 935 else 936 result = setIfChanged(SENSOR_SERVICEID, 'Tripped', 1, deviceId) 937 938 end 939 940 if (result) then 941 setIfChanged(HADEVICE_SID, 'LastUpdate', time, deviceId) 942 end 943 end 944 919 945 -- Thermostat 920 946 elseif (zwaveDeviceCategory4.thermostat[subCat]) then 921 debugLog("Z-Wave Thermostat: node " .. node .. " action: " .. action )947 debugLog("Z-Wave Thermostat: node " .. node .. " action: " .. action .. " command: " .. command) 922 948 local deviceId = getChild(nodeParent) 923 949 … … 927 953 -- current temperature -- 928 954 result = setIfChanged(TEMPSENSOR_SID, 'CurrentTemperature', action, deviceId) 955 956 elseif (command == "DON") then 957 -- Normal mode -- 958 result = setIfChanged(HVAC_MODE_SID, "EnergyModeStatus", "Normal", deviceId) 959 960 elseif (command == "DOF") then 961 -- ESM -- 962 result = setIfChanged(HVAC_MODE_SID, "EnergyModeStatus", "EnergySavingsMode", deviceId) 929 963 930 964 elseif (command == "CLISPH") then … … 1102 1136 -- RemoteLinc 1103 1137 if (insteonDeviceCategory0.remoteLinc[subCat]) then 1104 debugLog("Updating RemoteLinc name for: node " .. node )1138 debugLog("Updating RemoteLinc name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[insteonId]) 1105 1139 1106 1140 -- Scene Controller … … 1113 1147 -- KeypadLinc Dimmer 1114 1148 if (insteonDeviceCategory1.dimmerKPL[subCat]) then 1115 debugLog("Updating KeypadLinc Dimmer name for: node " .. node )1149 debugLog("Updating KeypadLinc Dimmer name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1116 1150 1117 1151 -- Dimmable light … … 1123 1157 -- FanLinc 1124 1158 elseif (insteonDeviceCategory1.fanLinc[subCat]) then 1125 debugLog("Updating FanLinc name for: node " .. node )1159 debugLog("Updating FanLinc name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1126 1160 1127 1161 -- Dimmable light … … 1133 1167 -- Dimmer 1134 1168 elseif (insteonDeviceCategory1.dimmer[subCat]) then 1135 debugLog("Updating Dimmer name for: node " .. node )1169 debugLog("Updating Dimmer name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1136 1170 1137 1171 luup.attr_set("name", string.format("%s", name), insteonToChildMap[parent]) … … 1144 1178 -- KeypadLinc Relay 1145 1179 if (insteonDeviceCategory2.relayKPL[subCat]) then 1146 debugLog("Updating KeypadLinc Relay name for: node " .. node )1180 debugLog("Updating KeypadLinc Relay name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1147 1181 1148 1182 -- Binary light … … 1154 1188 -- Relay / Switch 1155 1189 elseif (insteonDeviceCategory2.relay[subCat]) then 1156 debugLog("Updating Relay name for: node " .. node )1190 debugLog("Updating Relay name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1157 1191 1158 1192 luup.attr_set("name", string.format("%s", name), insteonToChildMap[parent]) … … 1164 1198 -- IOLinc 1165 1199 if (insteonDeviceCategory7.iolinc[subCat]) then 1166 debugLog("Updating IOLinc name for: node " .. node )1200 debugLog("Updating IOLinc name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1167 1201 1168 1202 -- Security Sensor 1169 luup.attr_set("name", string.format("%s", name), insteonToChildMap[parent])1203 --luup.attr_set("name", string.format("%s", name), insteonToChildMap[parent]) 1170 1204 1171 1205 -- Relay 1172 luup.attr_set("name", string.format("%s", name), insteonToChildMap[insteonId] .. " 2")1206 --luup.attr_set("name", string.format("%s", name), insteonToChildMap[insteonId] .. " 2") 1173 1207 end 1174 1208 … … 1178 1212 -- Motion Sensor 1179 1213 if (insteonDeviceCategory16.motionSensor[subCat]) then 1180 debugLog("Updating Motion Sensor name for: node " .. node )1214 debugLog("Updating Motion Sensor name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1181 1215 1182 1216 luup.attr_set("name", string.format("%s", name), insteonToChildMap[parent]) … … 1191 1225 -- Relay 1192 1226 if (zwaveDeviceCategory4.relay[subCat]) then 1193 debugLog("Updating Z-Wave Relay name for: node " .. node )1227 debugLog("Updating Z-Wave Relay name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1194 1228 1195 1229 -- Binary light … … 1198 1232 -- Dimmer 1199 1233 elseif (zwaveDeviceCategory4.dimmer[subCat]) then 1200 debugLog("Updating Z-Wave dimmer name for: node " .. node )1234 debugLog("Updating Z-Wave dimmer name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1201 1235 1202 1236 luup.attr_set("name", string.format("%s", name), insteonToChildMap[parent]) … … 1204 1238 -- Lock 1205 1239 elseif (zwaveDeviceCategory4.lock[subCat]) then 1206 debugLog("Updating Z-Wave lock name for: node " .. node )1240 debugLog("Updating Z-Wave lock name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1207 1241 1208 1242 luup.attr_set("name", string.format("%s", name), insteonToChildMap[parent]) 1243 1244 -- Thermostat 1245 elseif (zwaveDeviceCategory4.thermostat[subCat]) then 1246 debugLog("Updating Z-Wave thermostat name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1247 1248 luup.attr_set("name", string.format("%s", name), insteonToChildMap[parent]) 1249 1250 -- Motion Sensor 1251 elseif (zwaveDeviceCategory4.motionSensor[subCat]) then 1252 debugLog("Updating Z-Wave motionSensor name for: node " .. node .. " to: " .. name .. " for deviceid: " .. insteonToChildMap[parent]) 1253 1254 luup.attr_set("name", string.format("%s", name), insteonToChildMap[parent]) 1255 1209 1256 end 1210 1257 end … … 1625 1672 "urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1", "D_HVAC_ZoneThermostat1.xml", 1626 1673 "", "urn:upnp-org:serviceId:TemperatureSensor1,CurrentTemperature="..newStatus, false) 1674 1675 -- Motion Sensor 1676 elseif (zwaveDeviceCategory4.motionSensor[subCat]) then 1677 1678 local newStatus 1679 1680 debugLog("Creating Z-Wave motion sensor for: node " .. node) 1681 1682 -- tripped 1683 if (status ~= nil and status ~= " " and tonumber(status) == 1) then 1684 newStatus = 1 1685 1686 -- secure (not tripped) 1687 else 1688 newStatus = 0 1689 end 1690 1691 luup.chdev.append(device, children, 1692 string.format("%s", parent), string.format("%s", name), 1693 "urn:schemas-micasaverde-com:device:MotionSensor:1", "D_MotionSensor1.xml", 1694 "", "urn:micasaverde-com:serviceId:SecuritySensor1,Tripped=" .. newStatus .. 1695 "\n" .. "urn:micasaverde-com:serviceId:SecuritySensor1,Armed=0" .. 1696 "\nurn:garrettwp-com:serviceId:ISYController1,Family=4", false) 1627 1697 end 1628 1698 end
Note: See TracChangeset
for help on using the changeset viewer.