<html>
  <head>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-15">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hallo zusammen,<br>
    <br>
    momentan wird ja dSM-basiert der Stromverbrauch vom kompl.
    Stromkreis <br>
    geloggt. Die gezielte JSON-Abfrage eines Devices gibt momentan "0"
    zurück.<br>
    Ein permanentes Abfragen würde ja auch den Bus überlasten und der
    Traffic <br>
    über die Stromleitung würde erhöht.
    <meta name="ProgId" content="Word.Document">
    <meta name="Generator" content="Microsoft Word 11">
    <meta name="Originator" content="Microsoft Word 11">
    <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
    <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><br>
    <br>
    Wenn also das Device weitere Variablen erhalten würde:<br>
    <br>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-15">
    <!--
    
    [if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif][if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif][if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]-->
    <p class="MsoPlainText"><span style="" lang="EN-GB">    </span><span
        style="mso-ansi-language:EN-GB" lang="EN-GB">int</span><span
        style="" lang="EN-GB"> maxPowerConsumption;<br>
        <span style="mso-spacerun:yes">    </span></span><span
        style="mso-ansi-language:EN-GB" lang="EN-GB">(int </span><span
        style="" lang="EN-GB">minPowerConsumption;)<br>
        <span style="mso-spacerun:yes">    </span></span><span
        style="mso-ansi-language:EN-GB" lang="EN-GB">int </span><span
        style="mso-ansi-language:EN-GB" lang="EN-GB">standbyPowerConsumption;<br>
        <span style="mso-spacerun:yes">    </span>int configValue;</span></p>
    <meta name="ProgId" content="Word.Document">
    <meta name="Generator" content="Microsoft Word 11">
    <meta name="Originator" content="Microsoft Word 11">
    <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
    <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><br>
    MaxPowerConsumption ist ist der Stromverbrauch, den das Gerät bei<br>
    vollem Betrieb hat und wird bei dem ersten Initialisieren <br>
    durch das System ermittelt, indem, wenn ein komplett<br>
    neue Hardware gefunden wird, der Verbraucher einmal eingeschaltet
    wird<br>
    und der Stromverbrauch über den Sensor gemessen wird. Dann wird das<br>
    Gerät wieder ausgeschaltet und erneut der Stromverbrauch ermittelt<br>
    (Standby-Verbrauch). <br>
    <br>
    Diese Variablen werden in der Apartment.xml beim jeweiligen<br>
    Device gespeichrt. <br>
    <br>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-15">
    <!--
    
    [if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif][if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif][if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]-->
    <p class="MsoPlainText"><span style="" lang="EN-GB">modelpersistence.cpp<br>
        <br>
        void ModelPersistence::loadDevices(Node* _node) {</span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB"><br>
              ... // Code</span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB"> <span
          style="mso-tab-count:1">      </span>int maxPowerConsumption
        = 0;<br>
        <span style="mso-spacerun:yes">      </span>if
        (elem->hasAttribute("maxPowerConsumption"))<br>
        <span style="mso-spacerun:yes">      </span><span
          style="mso-tab-count:1"> </span><span
          style="mso-spacerun:yes">  </span>maxPowerConsumption =
        strToInt(elem->getAttribute("maxPowerConsumption"));<br>
        <br>
        <span style="mso-spacerun:yes">      </span>int
        minPowerConsumption = 0;<br>
        <span style="mso-spacerun:yes">      </span>if
        (elem->hasAttribute("minPowerConsumption"))<br>
        <span style="mso-spacerun:yes">      </span><span
          style="mso-tab-count:1"> </span><span
          style="mso-spacerun:yes">  </span>minPowerConsumption =
        strToInt(elem->getAttribute("minPowerConsumption"));<br>
        <br>
        <span style="mso-spacerun:yes">      </span><span
          style="mso-spacerun:yes"></span>int standbyPowerConsumption =
        0;<br>
        <span style="mso-spacerun:yes">      </span>if
        (elem->hasAttribute("standbyPowerConsumption"))<br>
        <span style="mso-spacerun:yes">      </span><span
          style="mso-tab-count:1">  </span><span
          style="mso-spacerun:yes">  </span>standbyPowerConsumption =
        strToInt(elem->getAttribute("standbyPowerConsumption"));<br>
        <br>
      </span></p>
    <p class="MsoPlainText"><span style="mso-ansi-language:EN-GB"
        lang="EN-GB">      int configValue = 0;<br>
        <span style="mso-spacerun:yes">          </span>if
        (elem->hasAttribute("configValue"))<br>
        <span style="mso-spacerun:yes">        </span><span
          style="mso-tab-count:1">    </span><span
          style="mso-spacerun:yes">  </span>configValue =
        strToInt(elem->getAttribute("configValue"));</span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB"><br>
            ... // weiter Code<br>
      </span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB"><br>
      </span>
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-15">
    </p>
    <p class="MsoPlainText">
      <meta name="ProgId" content="Word.Document">
      <meta name="Generator" content="Microsoft Word 11">
      <meta name="Originator" content="Microsoft Word 11">
      <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
      <!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
      <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]--> </p>
    <p class="MsoPlainText"><span style="" lang="EN-GB">   
        newDevice->setConfigValue(configValue);<br>
        <span style="mso-spacerun:yes">          </span>       
        newDevice->setStandbyPowerConsumption(standbyPowerConsumption);<br>
        <span style="mso-spacerun:yes">          </span>newDevice->setMinPowerConsumption(minPowerConsumption);<br>
        <span style="mso-spacerun:yes">          </span>newDevice->setMaxPowerConsumption(maxPowerConsumption);<br>
      </span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB"><br>
            ... // weiter Code<br>
      </span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB">}<br>
      </span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB"><br>
        <br>
      </span>
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-15">
    </p>
    <p class="MsoPlainText">
      <meta name="ProgId" content="Word.Document">
      <meta name="Generator" content="Microsoft Word 11">
      <meta name="Originator" content="Microsoft Word 11">
      <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
      <!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]-->
      <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]--> </p>
    <p class="MsoPlainText"><span style="mso-ansi-language:EN-GB"
        lang="EN-GB">void deviceToXML( .. )<br>
        <br>
        pDeviceNode->setAttribute("minPowerConsumption",
        intToString(_pDevice->getMinPowerConsumption()));<br>
        <span style="mso-spacerun:yes">    </span>pDeviceNode->setAttribute("maxPowerConsumption",


        intToString(_pDevice->getMaxPowerConsumption()));<br>
        <span style="mso-spacerun:yes">    </span>pDeviceNode->setAttribute("standbyPowerConsumption",


        intToString(_pDevice->getStandbyPowerConsumption()));<br>
        <span style="mso-spacerun:yes">    </span>pDeviceNode->setAttribute("configValue",


        intToString(_pDevice->getConfigValue()));</span></p>
    <span style="mso-ansi-language:EN-GB" lang="EN-GB"><span
        style="mso-spacerun:yes"></span><br>
      ...<br>
    </span>
    <meta name="ProgId" content="Word.Document">
    <meta name="Generator" content="Microsoft Word 11">
    <meta name="Originator" content="Microsoft Word 11">
    <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
    <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><br>
    In der Klasse dss.cpp die Aufforderung, sollte das System mal
    herunter fahren,<br>
    unbedingt die Apartment.xml aktualisieren<br>
    <br>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-15">
    <!--
    
    [if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif][if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif][if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]-->
    <p class="MsoPlainText"><span style="" lang="EN-GB">dss.cpp<br>
        <br>
      </span></p>
    <p class="MsoPlainText"><span style="mso-ansi-language:EN-GB"
        lang="EN-GB">... //Code<br>
        m_State = ssTerminating;<br>
        m_pModelMaintenance.get()->addModelEvent(new
        ModelEvent(ModelEvent::etModelDirty));<br>
        <br>
        std::for_each(m_Subsystems.begin(), m_Subsystems.end(),
        StopSubsystem);<br>
        m_pEventQueue->shutdown();<br>
        m_pEventInterpreter->terminate();<br>
      </span></p>
    <meta name="ProgId" content="Word.Document">
    <meta name="Generator" content="Microsoft Word 11">
    <meta name="Originator" content="Microsoft Word 11">
    <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
    <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><br>
    ... <br>
    <br>
    Wir haben nun einmal persistent was das Gerät verbraucht im Betrieb
    und<br>
    im StandBy, die Variable configValue die wir brauchen werden um zu
    wissen,<br>
    ob das Gerät an oder aus oder gedimmt ist. Beim Wert 0 ist es aus, <br>
    bei 255 ist es an und dazwischen ist es halt gedimmt. Wenn nun eine<br>
    callScene aufgerufen wird, muss diese Variable aktualisiert werden.<br>
    <br>
    Die Methode getPowerConsumption würde dann so aussehen:<br>
    <br>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-15">
    <!--
    
    [if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif][if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif][if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]-->
    <p class="MsoPlainText"><span style="mso-ansi-language:EN-GB"
        lang="EN-GB">unsigned long Device::getPowerConsumption() {<br>
        <span style="mso-tab-count:1">      </span><span
          style="mso-spacerun:yes">  </span>if (isPresent()) {<br>
        <span style="mso-tab-count:2">            </span><span
          style="mso-spacerun:yes">  </span>if (configValue == 0)<br>
        <span style="mso-tab-count:3">                  </span><span
          style="mso-spacerun:yes">  </span>return
        standbyPowerConsumption;<br>
        <span style="mso-tab-count:2">            </span><span
          style="mso-spacerun:yes">  </span>else<br>
        <span style="mso-tab-count:3">                  </span><span
          style="mso-spacerun:yes">  </span>return
        maxPowerConsumption*(configValue/255);<br>
        <span style="mso-tab-count:1">      </span><span
          style="mso-spacerun:yes">  </span>}<br>
        <span style="mso-tab-count:1">      </span><span
          style="mso-spacerun:yes">  </span>else return 0;<br>
        <br>
        } // getPowerConsumption</span></p>
    <meta name="ProgId" content="Word.Document">
    <meta name="Generator" content="Microsoft Word 11">
    <meta name="Originator" content="Microsoft Word 11">
    <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
    <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><br>
    Natürlich ist das jetzt nicht perfekt und geht auch nur bei
    Verbrauchern, die<br>
    einen konstanten Stromverbrauch haben und nicht dynamisch wie etwa
    bei<br>
    Computern die unter Vollast mehr verbrauchen als unter
    Office-Betrieb.<br>
    Aber bei Lampen geht das (bei Leuchtmittelwechsel mit andere
    Wattzahl<br>
    muss eine Kalibrierung durchgeführt werden) und wie gesagt bei
    "normalen"<br>
    Geräten. In der minPowerConsumption kann man speichern, wenn<br>
    ein Gerät über eine Leistungsstufe verfügt (ähnlich wie beim
    Ventilator<br>
    mit versch. Leistungsstufen) wobei dann wahrscheinlich mehr zwischen<br>
    Variablen gebraucht würden.<br>
    <br>
    Die Methode isOn vielleicht:<br>
    <br>
    <p class="MsoPlainText"><span style="" lang="EN-GB">bool
        Device::isOn() const {</span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB">    if
        (isPresent()) {</span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB">        if
        (configValue == 0)<br>
                    return false;<br>
                else return true;<br>
            }</span></p>
    <p class="MsoPlainText"><span style="mso-ansi-language:EN-GB"
        lang="EN-GB"><span style="mso-spacerun:yes">    else return
          false;</span><br>
        } // isOn</span></p>
    <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
    <br>
    Soweit die Idee, nicht vollkommen da jeder Statuswechsel, der das
    Gerät<br>
    betrifft (an, aus und dimmen) im configValue festgehalten werden
    muss.<br>
    Aber das wäre schonmal eine große Steigerung zu jetzt, wo man nur <br>
    bei Device getPowerConsumption "0" erhält.<br>
    <br>
    Und wir erzeugen hier keine zusätzliche Busbelastung! Es muss nur
    ledigleich <br>
    einmal ermittelt werden, was das Gerät verbraucht.<br>
    <br>
    Für das geräteorientierte Loggen in <br>
    <br>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-15">
    <!--
    [if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif][if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif][if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]-->
    <p class="MsoPlainText"><span style="" lang="EN-GB">metering.h<br>
        <br>
      </span></p>
    <p class="MsoPlainText"><span style="" lang="EN-GB"> typedef
        std::map<boost::shared_ptr<Device>,<br>
        <span style="mso-spacerun:yes">                             </span>boost::shared_ptr<std::string>
>

        DeviceCachedSeriesMap;<br>
        DeviceCachedSeriesMap m_DeviceCachedSeries;<br>
        <br>
        boost::shared_ptr<std::string>
        getOrCreateDeviceCachedSeries(<br>
        <span style="mso-spacerun:yes">              </span>boost::shared_ptr<MeteringConfigChain>

        _pChain,<br>
        <span style="mso-spacerun:yes">              </span>boost::shared_ptr<Device>
_device

        );<br>
        <br>
        void postDeviceMeteringEvent(boost::shared_ptr<Device>
        _device, <br>
        int _valuePower, int _valueEnergy, DateTime _sampledAt);<br>
      </span></p>
    <p class="MsoPlainText"><span style="mso-ansi-language:EN-GB"
        lang="EN-GB"><br>
      </span></p>
    <meta name="ProgId" content="Word.Document">
    <meta name="Generator" content="Microsoft Word 11">
    <meta name="Originator" content="Microsoft Word 11">
    <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
    <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
--> </style>nach dem Muster vom dSM. Entsprechend Änderungen in der
    Datei metering.cpp.<br>
    <br>
    In modelmaintenace.cpp :<br>
    <br>
    ... <br>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-15">
    <!--
    [if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif][if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif][if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]--><span style="font-size:10.0pt;font-family: "Courier
      New";mso-fareast-font-family:"Times New
      Roman";mso-ansi-language:EN-GB;
      mso-fareast-language:DE;mso-bidi-language:AR-SA" lang="EN-GB">case
      ModelEvent::etMeteringValues:</span>
    <meta name="ProgId" content="Word.Document">
    <meta name="Generator" content="Microsoft Word 11">
    <meta name="Originator" content="Microsoft Word 11">
    <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
    <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><br>
    ... <br>
    <meta http-equiv="Content-Type" content="text/html;
      charset=ISO-8859-15">
    <!--
    [if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
   <w:DontGrowAutofit/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif][if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif][if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Normale Tabelle";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}
</style>
<![endif]-->
    <p class="MsoPlainText"><span style="" lang="EN-GB">m_pMetering->postMeteringEvent(meter,
power,

        meter->getCachedEnergyMeterValue(), DateTime());</span></p>
    <p class="MsoPlainText"><br>
      // Direkt nach dem DSM<br>
      <span style="" lang="EN-GB"></span></p>
    <p class="MsoPlainText"><span style="mso-ansi-language:EN-GB"
        lang="EN-GB">for (int i=0; i <
        meter->getDevices().length(); i++) {<br>
        <span style="mso-spacerun:yes">            </span><span
          style="mso-tab-count: 1">      </span>dss_dsid_t deviceID =
        meter->getDevices().get(i).getDSID();<br>
        <span style="mso-spacerun:yes">            </span><span
          style="mso-tab-count: 1">      </span>boost::shared_ptr<Device>
        device =
        (meter->getDevices().getByDSID(deviceID)).getDevice();<br>
        <span style="mso-spacerun:yes">            </span><span
          style="mso-tab-count: 1">      </span>m_pMetering->postDeviceMeteringEvent(device

        ,<br>
                device->getPowerConsumption(),
        device->getEnergyMeterValue, DateTime());// <br>
        <span style="mso-spacerun:yes"></span>}</span></p>
    <meta name="ProgId" content="Word.Document">
    <meta name="Generator" content="Microsoft Word 11">
    <meta name="Originator" content="Microsoft Word 11">
    <link rel="File-List"
href="file:///C:%5CUsers%5CALEXAN%7E1%5CAppData%5CLocal%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml">
    <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-font-family:"Times New Roman";}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;
        mso-header-margin:36.0pt;
        mso-footer-margin:36.0pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><br>
    In der Apartment.xml könnte man auch geräteorientiert festhalten,
    was das Gerät bisher<br>
    verbraucht hat, ähnlich wie beim EnergyCounter im dSM.<br>
    <br>
    Das Ganze ist natürlich ausbaufähig. <br>
    Hin und wieder müßten Sensor-Kontrollabfragen erfolgen.<br>
    <br>
  </body>
</html>