41
WeatherCat General Discussion / Re: Generic XML and Meteobridge Success
« Last post by staze on February 11, 2024, 08:37:21 PM »Update: Not sure HOW I fixed it, might have been adding contenttype to the url. So it's now: "/cgi-bin/template.cgi?templatefile=weathercat.txt&contenttype=application/xml"
----
Previous post
@rpmik: Thanks for this, elagache linked me from my thread asking about this. What I'm not sure about is I'm trying to use a template file, and WC refuses to say it's valid.
Have you had this issue, and if so, how did you get around it? I can't tell if WC is expecting xml headers, or...?
fwiw, I'm using a template file, which you can put in templates, and call as /cgi-bin/template.cgi?templatefile=weathercat.txt (in my case).
The template is just
This validates as valid xml, and the fields populate correctly from MB, but WC just refuses to think it's valid... =(
fwiw, my connection string just looks like
meteobridge:password@10.0.6.22/cgi-bin/template.cgi?templatefile=weathercat.txt
I've tried with and without the http:// at the start, and that doesn't matter. =(
Also not sure about your example, it seems to have random 52's in it? It decodes to
----
Previous post
@rpmik: Thanks for this, elagache linked me from my thread asking about this. What I'm not sure about is I'm trying to use a template file, and WC refuses to say it's valid.
Have you had this issue, and if so, how did you get around it? I can't tell if WC is expecting xml headers, or...?
fwiw, I'm using a template file, which you can put in templates, and call as /cgi-bin/template.cgi?templatefile=weathercat.txt (in my case).
The template is just
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<weathercat>
<value>
<name>AirTemp_C</name>
<data>[th0temp-act]</data>
</value>
<value>
<name>IntTemp_C</name>
<data>[thb0temp-act]</data>
</value>
<value>
<name>RH</name>
<data>[th0hum-act]</data>
</value>
<value>
<name>IntRH</name>
<data>[thb0hum-act]</data>
</value>
<value>
<name>Barometer_hPa</name>
<data>[thb0press-act]</data>
</value>
<value>
<name>WindSpeed_ms</name>
<data>[wind0wind-act]</data>
</value>
<value>
<name>WindDirect_deg</name>
<data>[wind0dir-act]</data>
</value>
<value>
<name>Rain_mm</name>
<data>[rain0total-act]</data>
</value>
</weathercat>
This validates as valid xml, and the fields populate correctly from MB, but WC just refuses to think it's valid... =(
fwiw, my connection string just looks like
meteobridge:password@10.0.6.22/cgi-bin/template.cgi?templatefile=weathercat.txt
I've tried with and without the http:// at the start, and that doesn't matter. =(
Also not sure about your example, it seems to have random 52's in it? It decodes to
Code: [Select]
user:password@192.168.x.y/cgi-bin/template.cgi?<value><name>AirTemp_C</name><data>52</[th0temp-act]></value><value><name>IntTemp_C</name><data>52</[thb0temp-act]></value><value><name>Solar</name><data>52</[sol0rad-act]></value><value><name>UVIndex</name><data>52</[uv0index-act]></value><value><name>Barometer_hPa</name><data>52</[thb0press-act]></value><value><name>WindSpeed_ms</name><data>52</[wind0wind-act]></value><value><name>WindDirect_deg</name><data>52</[wind0dir-act]></value><value><name>Rain_mm</name><data>52</[rain0total-act]></value><value><name>RH</name><data>52</[th0hum-act]></value><value><name>IntRH</name><data>52</[thb0hum-act]></value>