Changeset 41
- Timestamp:
- 2012-07-25 00:02:14 (13 years ago)
- Files:
-
- 2 edited
-
I_RFXCOM.xml (modified) (14 diffs)
-
S_EnergyMeter1.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
I_RFXCOM.xml
r40 r41 34 34 sensorTypeBarometer = 2048, 35 35 sensorTypeRain = 4096, 36 -- Start of addition --37 36 sensorTypePowerMeter = 8192, 38 37 sensorTypeEnergyMeter = 16384, 39 -- End of addition --40 38 41 39 sensorManufacturerX10 = "X10", … … 81 79 RFXCOM_HAR_Count = 0 82 80 RFXCOM_HAR_Devices = {} 83 -- Start of addition --84 81 RFXCountEM = 0 85 82 RFXDevicesEM = {} 86 -- End of addition --87 83 88 84 THIS_DEVICE = lul_device … … 193 189 end 194 190 195 -- Start of addition --196 191 -- Check on electric meter devices 197 192 if (tostring(v.device_type) == "urn:schemas-micasaverde-com:device:EnergyMeter:1") then … … 200 195 luup.log("Registered device " .. RFXDevicesEM[RFXCountEM] .. " as Energy Meter sensor ".. RFXCountEM) 201 196 end 202 -- End of addition --203 197 end 204 198 end … … 214 208 luup.log(" rain sensors: " .. RFXCountRS2) 215 209 luup.log(" anemo sensors: " .. RFXCountAS2) 216 -- Start of addition --217 210 luup.log(" energy sensors: " .. RFXCountEM) 218 -- End of addition219 211 220 212 luup.log("Open socket for read " .. ipAddress .. " port " .. ipPortRead ) … … 591 583 local lsCommand = string.sub( psCommand, 2) 592 584 local lsSensorManufacturer = RFXConstants.sensorManufacturerOWL 593 -- Start of deletion --594 -- local lnSensorType = RFXConstants.sensorTypeController595 -- End of deletion596 -- Start of addition --597 585 local lnSensorType = RFXConstants.sensorTypeEnergyMeter 598 -- End of addition 586 599 587 local lsID = "" 600 588 local lsCmd = "" … … 1377 1365 end 1378 1366 1379 -- Start of addition --1380 1367 ------------------------------------------------------------------------------------ 1381 1368 -- Next with Energy Meter devices … … 1385 1372 "urn:schemas-micasaverde-com:device:EnergyMeter:1", "D_EnergyMeter1.xml","","",false) 1386 1373 end 1387 -- End of addition --1388 1374 1389 1375 ------------------------------------------------------------------------------------ … … 1490 1476 end 1491 1477 1492 -- Start of addition --1493 1478 ------------------------------------------------------------------------------------ 1494 1479 -- Add Energy Meter sensor … … 1500 1485 RFXDevicesEM[RFXCountEM] = "EM/" .. lsID 1501 1486 end 1502 -- End of addition --1503 1504 1487 1505 1488 luup.log("Tree buildup with number child devices:") … … 1514 1497 luup.log(" rain sensors: " .. RFXCountRS2) 1515 1498 luup.log(" Anemo sensors: " .. RFXCountAS2) 1516 -- Start of addition --1517 1499 luup.log(" energy sensors: " .. RFXCountEM) 1518 -- End of addition --1519 1500 1520 1501 -- Synch the new tree with the old three … … 1705 1686 end 1706 1687 end 1707 -- Start of addition --1708 1688 fullId = "EM/" .. lsID 1709 1689 if bitw.band(lnSensorType,RFXConstants.sensorTypeEnergyMeter) ~= 0 … … 1717 1697 end 1718 1698 if lsKey == "currentpower" then 1719 luup.log("SET CURRENT POWER from " .. lsID .. " with value " .. lsValue)1699 luup.log("SET CURRENTPOWER from " .. lsID .. " with value " .. lsValue) 1720 1700 luup.variable_set("urn:upnp-org:serviceId:EnergyMeter1", "CurrentPower", lsValue, device) 1721 1701 end 1722 1702 if lsKey == "totalenergy" then 1723 luup.log("SET TOTAL ENERGY from " .. lsID .. " with value " .. lsValue)1703 luup.log("SET TOTALENERGY from " .. lsID .. " with value " .. lsValue) 1724 1704 luup.variable_set("urn:upnp-org:serviceId:EnergyMeter1", "TotalEnergy", lsValue, device) 1725 1705 end … … 1730 1710 end 1731 1711 end 1732 -- End of addition -- 1733 end 1734 1712 end 1735 1713 end 1736 1737 1714 end 1738 1715 -
S_EnergyMeter1.xml
r40 r41 19 19 </stateVariable> 20 20 <stateVariable> 21 <name>TotalEnergy</name> 22 <sendEventsAttribute>yes</sendEventsAttribute> 23 <dataType>i4</dataType> 24 <defaultValue>0</defaultValue> 25 <shortCode>totalenergy</shortCode> 26 </stateVariable> 27 <stateVariable> 21 28 <sendEventsAttribute>no</sendEventsAttribute> 22 29 <name>Battery</name> 23 30 <dataType>string</dataType> 24 31 <shortCode>battery</shortCode> 25 </stateVariable>26 <stateVariable>27 <sendEventsAttribute>no</sendEventsAttribute>28 <name>Battery2</name>29 <dataType>string</dataType>30 <shortCode>battery2</shortCode>31 32 </stateVariable> 32 33 <stateVariable>
Note: See TracChangeset
for help on using the changeset viewer.