Changeset 41


Ignore:
Timestamp:
2012-07-25 00:02:14 (13 years ago)
Author:
evanes
Message:

OWL Energymeter by DjMomo? corrections by Evert

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • I_RFXCOM.xml

    r40 r41  
    3434    sensorTypeBarometer = 2048, 
    3535    sensorTypeRain = 4096, 
    36 -- Start of addition --  
    3736    sensorTypePowerMeter = 8192, 
    3837    sensorTypeEnergyMeter = 16384, 
    39 -- End of addition -- 
    4038     
    4139    sensorManufacturerX10 = "X10", 
     
    8179    RFXCOM_HAR_Count = 0 
    8280    RFXCOM_HAR_Devices = {} 
    83 -- Start of addition --  
    8481    RFXCountEM  = 0 
    8582    RFXDevicesEM = {} 
    86 -- End of addition -- 
    8783     
    8884    THIS_DEVICE = lul_device 
     
    193189        end 
    194190 
    195 -- Start of addition -- 
    196191        -- Check on electric meter devices  
    197192        if (tostring(v.device_type) == "urn:schemas-micasaverde-com:device:EnergyMeter:1") then 
     
    200195          luup.log("Registered device " .. RFXDevicesEM[RFXCountEM] .. " as Energy Meter sensor ".. RFXCountEM) 
    201196        end 
    202 -- End of addition -- 
    203197      end 
    204198    end 
     
    214208    luup.log("       rain sensors: " .. RFXCountRS2) 
    215209    luup.log("      anemo sensors: " .. RFXCountAS2) 
    216 -- Start of addition -- 
    217210    luup.log("     energy sensors: " .. RFXCountEM) 
    218 -- End of addition 
    219211       
    220212    luup.log("Open socket for read " .. ipAddress .. " port " .. ipPortRead ) 
     
    591583    local lsCommand = string.sub( psCommand, 2) 
    592584    local lsSensorManufacturer = RFXConstants.sensorManufacturerOWL 
    593 -- Start of deletion --     
    594 --  local lnSensorType = RFXConstants.sensorTypeController 
    595 -- End of deletion 
    596 -- Start of addition --     
    597585    local lnSensorType = RFXConstants.sensorTypeEnergyMeter 
    598 -- End of addition 
     586 
    599587    local lsID = "" 
    600588    local lsCmd = "" 
     
    13771365      end 
    13781366 
    1379 -- Start of addition -- 
    13801367      ------------------------------------------------------------------------------------ 
    13811368      -- Next with Energy Meter devices 
     
    13851372        "urn:schemas-micasaverde-com:device:EnergyMeter:1", "D_EnergyMeter1.xml","","",false) 
    13861373      end 
    1387 -- End of addition -- 
    13881374 
    13891375      ------------------------------------------------------------------------------------       
     
    14901476      end 
    14911477 
    1492 -- Start of addition -- 
    14931478      ------------------------------------------------------------------------------------ 
    14941479      -- Add Energy Meter sensor 
     
    15001485        RFXDevicesEM[RFXCountEM] = "EM/" .. lsID 
    15011486      end 
    1502 -- End of addition -- 
    1503       
    15041487       
    15051488      luup.log("Tree buildup with number child devices:") 
     
    15141497      luup.log("       rain sensors: " .. RFXCountRS2) 
    15151498      luup.log("      Anemo sensors: " .. RFXCountAS2) 
    1516 -- Start of addition -- 
    15171499      luup.log("     energy sensors: " .. RFXCountEM) 
    1518 -- End of addition -- 
    15191500       
    15201501      -- Synch the new tree with the old three 
     
    17051686            end 
    17061687        end 
    1707 -- Start of addition -- 
    17081688        fullId = "EM/" .. lsID 
    17091689        if bitw.band(lnSensorType,RFXConstants.sensorTypeEnergyMeter) ~= 0 
     
    17171697              end 
    17181698              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) 
    17201700                luup.variable_set("urn:upnp-org:serviceId:EnergyMeter1", "CurrentPower", lsValue, device) 
    17211701              end 
    17221702              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) 
    17241704                luup.variable_set("urn:upnp-org:serviceId:EnergyMeter1", "TotalEnergy", lsValue, device) 
    17251705              end 
     
    17301710            end 
    17311711        end 
    1732 -- End of addition -- 
    1733       end 
    1734        
     1712      end 
    17351713    end  
    1736  
    17371714  end 
    17381715  
  • S_EnergyMeter1.xml

    r40 r41  
    1919    </stateVariable> 
    2020    <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> 
    2128       <sendEventsAttribute>no</sendEventsAttribute> 
    2229       <name>Battery</name> 
    2330       <dataType>string</dataType> 
    2431       <shortCode>battery</shortCode> 
    25     </stateVariable> 
    26     <stateVariable> 
    27        <sendEventsAttribute>no</sendEventsAttribute> 
    28        <name>Battery2</name> 
    29        <dataType>string</dataType> 
    30        <shortCode>battery2</shortCode> 
    3132    </stateVariable> 
    3233    <stateVariable> 
Note: See TracChangeset for help on using the changeset viewer.