.xml för att läsa ur luftfuktighetsmätaren. *löst*

Beyond Measure är En mycket flexibel Windowsmjukvara med stöd för ett mycket stort antal 1wire-enheter. Mjukvaran kan även skapa avancerade grafer.

Moderator: elf98

Kategoriregler
Vill du visa bilder i ditt inlägg? Använd funktionen "Ladda upp bilaga" nedanför textrutan!
bjornsson
Hemautomation - det är mer än en hobby
Inlägg: 403
Blev medlem: 25 aug 2010, 09:06
Ort: Bräcke

.xml för att läsa ur luftfuktighetsmätaren. *löst*

Inlägg av bjornsson » 25 jan 2012, 19:08

*löst*
Hittade hur och vad jag skulle ta bort =)


Undrar om någon ha en fungerande xml för att kunna läsa ur värdet ur en mysql databas till en luftfuktighetsmätare?

Så jag bara kan peta in mina värden från databasen =)

Har kollat på denna, men är så många olika värden där så jag vet inte riktigt var jag ska böja =)
Så en lite mer strippad vore fint :)

Kod: Markera allt

    <GraphConfig>
      <ImageSettings Width="1200" Height="600" AntiAliasing="Graphics"/>
      <SaveTo>D:\www\huset\Graphs\Temp_Humidity_Terrarium_Day.png</SaveTo>
      <Schedule>18 * * * * *</Schedule>
      <ChartAppearance>
        <Background BackColor="255,0,0,0" BackSecondaryColor="255,100,100,100" Gradient="TopBottom" />
        <Border Color="255,100,100,100" Style="Solid" Width="1">          <Skin />
        </Border>
        <ChartAreas>
          <ChartArea BackColor="255,100,100,100" BackSecondaryColor="255,200,200,200" Gradient="HorizontalCenter" Name="TempHumidity_Basement" AutoPosition="true">
            <XAxis  IntervalType="Hours" Interval="1" LabelFormat="HH:mm"  LabelColor="255,140,140,140" Title="">
              <MajorGrid Enabled="true" IntervalType="Hours" Interval="4" Color="255,187,51,255" LineDashStyle="Dot" />
              <MajorTickMark Enabled="true" Color="255,130,130,130" Style="AcrossAxis"/>    
            </XAxis>
            <YAxis  IntervalType="Number" LabelColor="255,130,130,130" Title="" >
              <MajorGrid Enabled="true" IntervalType="Number" Interval="1" Color="255,0,0,0" LineDashStyle="Dot" />
              <MajorTickMark Enabled="true" Color="255,140,140,140"  Style="AcrossAxis"/>              
              <ScaleBreak Enabled="true" BreakLineStyle="Ragged" CollapsibleSpaceThreshold="10" LineColor="255,255,0,0" LineDashStyle="DashDot" LineWidth="2" MaxNumberOfBreaks="2" Spacing="3" />   	              
            </YAxis>
           
        <Legend DockToChartArea="True" Position="Top" ForeColor="255,0,0,0" BackColor="200,150,150,150" Style="Column" />

          </ChartArea>
          
                  </ChartAreas>
        
        <Title Text="Indoor - Temperature / Humidity - ( past 24h )" Visible="true" ForeColor="255,140,140,140" BackColor="0,0,0,0" />
      <CustomLabels>
	<Label ForeColor="255,80,80,80" FontSize="7"	  Text="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}"
		X="0"
		Y="95"
		Height="4" 
		Width="15"/>
</CustomLabels>
</ChartAppearance>
      <DataSources DefaultConnection="DatabaseConnectionCreatedByMAC">
       <Source ChartArea="TempHumidity_Basement" Name="HB_HTS_II_Temp" ChartType="Spline">
          <SourceAppearance AutomaticColoring="false" Color="255,96,13,13" BorderWidth="2" />
          <Legend>%LASTVALUE('HB_HTS_II_Temp')°C / %LASTVALUE('HB_HTS_II_Humidity') %RH   Attic</Legend>
          <Query>
            <DatabaseTable Name="020000013F315C26">
              <xml-include File="../../TableDefinition/Family10.xml" />
            </DatabaseTable>

            <Statement>

              <Timebased Start="-1D" End="NOW" Column="TimeStamp" />
            </Statement>
            <ValueMapping>
              <X SourceColumn="TimeStamp" />
              <Y SourceColumn="Temperature" />
            </ValueMapping>
          </Query>
        </Source>
        
         
        <Source  ChartArea="TempHumidity_Basement" Name="HB_HTS_II_Humidity" ChartType="Spline">
          <SourceAppearance AutomaticColoring="false" Color="255,96,13,13" BorderWidth="2"/>
          <Legend></Legend>
          <Query>
	         <DatabaseTable Name="Dummy">
		        <TableDefinition>
			         <Column Name="Hour" Type="DateTime"/>
			         <Column Name="AvgHumidity" Type="Double"/>
		        </TableDefinition>
	         </DatabaseTable>
	         <Statement>
		        <Custom>
		           <![CDATA[					
                   SELECT date_format(A.timestamp,'%Y-%m-%d %T') as "Hour",
                   round( AVG( 100*( ( A.VoltageChannel_2 / A.VoltageChannel_1 ) / ( 1.0305 + 0.000044 * B.Temperature - 0.0000011 * B.Temperature * B.Temperature ) ) ), 2 ) as "AvgHumidity"
                   FROM driftinfo.9C000000E75EA326 A, driftinfo.BB000801EDE86210 B
                   WHERE (date_format( A.timestamp,'%i' ) = date_format( B.timestamp,'%i' ))
                   AND A.timestamp between timestampadd(Hour,-24, Now()) and Now()
                   GROUP BY date_format( A.timestamp,'%Y-%m-%d %T' );
               ]]>
		        </Custom>
	         </Statement>
	        <ValueMapping>
		       <X SourceColumn="Hour" />
		       <Y SourceColumn="AvgHumidity" />
	        </ValueMapping>
         </Query>
        </Source>


        <Source ChartArea="TempHumidity_Basement" Name="HB_HTS_V_Temp" ChartType="Spline">
          <SourceAppearance AutomaticColoring="false" Color="255,244,170,170" BorderWidth="2"/>
          <Legend>%LASTVALUE('HB_HTS_V_Temp')°C / %LASTVALUE('HB_HTS_V_Humidity')%RH    Basement</Legend>
          <Query>
            <DatabaseTable Name="18000801EDA7E810">
              <xml-include File="../../TableDefinition/Family10.xml" />
            </DatabaseTable>
            <!-- The statement element may contain max one of the below listed child elements. -->
            <Statement>
              <!-- Predefined query statement that uses a time Interval to retrieve data. See note below. -->
              <Timebased Start="-1D" End="NOW" Column="TimeStamp" />
            </Statement>
            <ValueMapping>
              <X SourceColumn="TimeStamp" />
              <Y SourceColumn="Temperature" />
            </ValueMapping>
          </Query>
        </Source> 
        
        
        <Source  ChartArea="TempHumidity_Basement" Name="HB_HTS_V_Humidity" ChartType="Spline">
<!-- 18000801EDA7E810 is a DS18S20 Temp sensor, measuring temp. in basement -->          	
<!-- 52000000E7528026 is a DS2423 ,Smart Battery Monitor, measuring humidity in basement -->          	          	
          <SourceAppearance AutomaticColoring="false" Color="255,244,170,170" BorderWidth="2"/>

          <Legend></Legend>
          <Query>
	         <DatabaseTable Name="Dummy">
		        <TableDefinition>
			         <Column Name="Hour" Type="DateTime"/>
			         <Column Name="AvgHumidity" Type="Double"/>
		        </TableDefinition>
	         </DatabaseTable>
	         <Statement>
		        <Custom>
		           <![CDATA[					
                   SELECT date_format(A.timestamp,'%Y-%m-%d %T') as "Hour",
                   round( AVG( 100*( ( A.VoltageChannel_2 / A.VoltageChannel_1 ) / ( 1.0305 + 0.000044 * B.Temperature - 0.0000011 * B.Temperature * B.Temperature ) ) ), 2 ) as "AvgHumidity"
                   FROM driftinfo.52000000E7528026 A, driftinfo.18000801EDA7E810 B
                   WHERE (date_format( A.timestamp,'%i' ) = date_format( B.timestamp,'%i' ))
                   AND A.timestamp between timestampadd(Hour,-24, Now()) and Now()
                   GROUP BY date_format( A.timestamp,'%Y-%m-%d %T' );
               ]]>
		        </Custom>
	         </Statement>
	        <ValueMapping>
		       <X SourceColumn="Hour" />
		       <Y SourceColumn="AvgHumidity" />
	        </ValueMapping>
         </Query>
        </Source>        
  
      <Source ChartArea="TempHumidity_Basement" Name="1stFloor" ChartType="Spline">
          <SourceAppearance AutomaticColoring="true" BorderWidth="2"/>
          <Legend>%LASTVALUE('1stFloor')°C   1st Floor</Legend>
          <Query>
            <DatabaseTable Name="7400080189FB8F10">
              <xml-include File="../../TableDefinition/Family10.xml" />
            </DatabaseTable>
            <Statement>
              <Timebased Start="-1D" End="NOW" Column="TimeStamp" />
            </Statement>
            <ValueMapping>
              <X SourceColumn="TimeStamp" />
              <Y SourceColumn="Temperature" />
            </ValueMapping>
          </Query>
        </Source> 
      </DataSources>
    </GraphConfig>