Hi,
I’m pretty new to this but working things out as I go…
I need to find a way to read the “OutputVoltage” element from the following XML, which is accessed on my local network via the url http://192.168.1.10/meters.xml
<response>
<OutputPower>0.000</OutputPower>
<InputPower>0.000</InputPower>
<InputPower2>0.000</InputPower2>
<InputVoltage>0.0</InputVoltage>
<InputVoltage2>0.0</InputVoltage2>
<OutputVoltage>0.0</OutputVoltage>
<Irradiance>1339</Irradiance>
<Temperature>39.3</Temperature>
<Events>00000000000000000000000000000000</Events>
<HeaterPower>0.000</HeaterPower>
<GridPower>-2.544</GridPower>
</response>
I’d like to show this as a Number item and thereafter create a rule based on it value that sends conditional data to a specific MQTT topic (received by an arduino thats controlling a relay).
So far my attempts have failed though. My Item (home.items) is setup as follows;
Number OutPut "Output [%.2f kWh]" {http="<[http://192.168.1.10/:3000:XSLT(meters.xsl)]"}
with a transform (home.transform) of;
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="yes" method="xml" encoding="UTF-8" omit-xml-declaration="yes" />
<xsl:template match="/">
<xsl:value-of select="(//response/OutputVoltage)[last()]"/>
</xsl:template>
</xsl:stylesheet>
i’m clearly missing a step here though because no local copy of meters.xsl is being created in the transform folder - I assume thats how it works?
Would appreciate any help anyone can give me to get this data read from the XML and displayed on my openhab sitemap
Cheers