WeatherCat > WeatherCat Integration
In Lieu Of A WeatherCat Plugin For Indigo Domotics Home Automation Software
DaveHawk:
I am a long time user of both WeatherCat and Indigo. I have been getting my WC data with applelscript to create variables within Indigo. But Indigo, in the next release, is dropping support for applescript. However, a plugin for Indigo (Ghost XML) creates variables from either a JSON or XML feed - file or web interface. I would like to query WC with a list of tags and populate a file in either JSON or XML format to feed to the Indigo plugin. I have no web experience and have no idea how this can be done. I am wondering if anyone has any ideas that will help me out?
Thanks.
elagache:
Dear DaveHawk and WeatherCat troubleshooters,
Since this is your first posting on the WeatherCat forum, let me welcome you here!
--- Quote from: DaveHawk on December 19, 2018, 10:29:44 PM ---I am a long time user of both WeatherCat and Indigo. I have been getting my WC data with applelscript to create variables within Indigo. But Indigo, in the next release, is dropping support for applescript. However, a plugin for Indigo (Ghost XML) creates variables from either a JSON or XML feed - file or web interface. I would like to query WC with a list of tags and populate a file in either JSON or XML format to feed to the Indigo plugin. I have no web experience and have no idea how this can be done. I am wondering if anyone has any ideas that will help me out?
--- End quote ---
WeatherCat can generate HTML pages that replace WeatherCat tags with actual data. XML is extremely similar to HTML and you could create your own XML files very easily using WeatherCat's tag generation facility. Here is a tiny XML file:
--- Code: ---<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
--- End code ---
The example is from this page:
https://www.w3schools.com/xml/xml_examples.asp
There is a full tutorial on this page:
https://www.w3schools.com/xml/default.asp
The idea is to generalize what HTML is like where data types are like HTML tags. So in the example above the overall data type is a note. Inside are 4 types of data: the from person the to person the heading and the message body. These are arbitrary. In your case you would choose data type names that would match the variables you are trying to import into Indigo.
It might take a little horsing around, but you should be able to get WeatherCat's web template tool to make the files you need. Take a look at the documentation for Custom web that you will find starting on page 102 of the current WeatherCat manual.
If you have additional questions don't hesitate to ask. We have a number of power HTML users, they should be able to help you get an XML file that will satisfy your plugin.
Cheers, Edouard
DaveHawk:
Elagache,
Thank you for your answer and suggestions - it looks like I have my work cut out for me. I have ordered books from the library and will look into the links you provided. For my clarification: it seems if I am going to use the Indigo plugin I mentioned, I will have to write my code in XML and then I will have XML files that I can use for input to the plugin. Am I on the right track, or have I gone off the track?
Thanks again.
elagache:
Dear DaveHawk and WeatherCat scripters,
--- Quote from: DaveHawk on December 20, 2018, 06:06:57 PM ---Thank you for your answer and suggestions - it looks like I have my work cut out for me. I have ordered books from the library and will look into the links you provided. For my clarification: it seems if I am going to use the Indigo plugin I mentioned, I will have to write my code in XML and then I will have XML files that I can use for input to the plugin. Am I on the right track, or have I gone off the track?
--- End quote ---
I don't think it is as hard as you are imagining it. WeatherCat can generate HTML files, but doesn't have any awareness of HTML. It simply replaces the tags that are described in the section I mentioned with the actual values. So WeatherCat can produce the files without you doing any coding. What you'll need is an example of the XML file that the Indigo plugin is expecting. It should look like the example I posted earlier with the names referring to the variables that you want to import into Indigo. Once you know which names to use, WeatherCat can populate the XML files with the data. You need to learn a bit more about how WeatherCat creates custom web files. You don't need to have the files uploaded to a server. WeatherCat leaves the generated files in a folder on your Mac. All you need to do is point the Indigo plugin at those files and it should work.
Don't hesitate to ask more questions. I've never done anything in XML but the concept should work okay.
Cheers, Edouard
DaveHawk:
Dear elagache thank you yet again,
Here is an example of a XML file downloaded from WeatherLink 2.0 that can be used for input to the Indigo plugin. If someone could provide a snippet of the code needed to generate the same format from WC, it would be appreciated.
--- Code: ---This XML file does not appear to have any style information associated with it. The document tree is shown below.
<current_observation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:noNamespaceSchemaLocation="http://www.weather.gov/view/current_observation.xsd">
<credit>Davis Instruments Corp.</credit>
<credit_URL>http://www.davisnet.com</credit_URL>
<disclaimer_url>http://www.davisnet.com/about/terms.asp</disclaimer_url>
<copyright_url>http://www.davisnet.com/about/terms.asp</copyright_url>
<privacy_policy_url>http://www.davisnet.com/about/privacy.asp</privacy_policy_url>
<image>
<url>
http://www.weatherlink.com/images/Logo_Davis_reflxblu.jpg
</url>
<title>Davis WeatherLink</title>
<link>http://www.weatherlink.com</link>
</image>
<suggested_pickup>15 minutes after the hour</suggested_pickup>
<suggested_pickup_period>60</suggested_pickup_period>
<dewpoint_c>3.3</dewpoint_c>
<dewpoint_f>38.0</dewpoint_f>
<dewpoint_string>38.0 F (3.3 C)</dewpoint_string>
<heat_index_c>4.4</heat_index_c>
<heat_index_f>40.0</heat_index_f>
<heat_index_string>40.0 F (4.4 C)</heat_index_string>
<location>Canal Winchester, OH, USA</location>
<latitude>39.82098</latitude>
<longitude>-82.80009</longitude>
<observation_time>Last Updated on Dec 21 2018, 9:12 am EST</observation_time>
<observation_time_rfc822>Fri, 21 Dec 2018 09:12:46 -0500</observation_time_rfc822>
<pressure_in>29.359</pressure_in>
<pressure_mb>994.2</pressure_mb>
<pressure_string>994.2 mb</pressure_string>
<relative_humidity>93</relative_humidity>
<station_id>XXXXXXXX</station_id>
<temp_c>4.4</temp_c>
<temp_f>39.9</temp_f>
<temperature_string>39.9 F (4.4 C)</temperature_string>
<wind_degrees>342</wind_degrees>
<wind_dir>North-northwest</wind_dir>
<wind_kt>3.5</wind_kt>
<wind_mph>4.0</wind_mph>
<windchill_c>2.8</windchill_c>
<windchill_f>37.0</windchill_f>
<windchill_string>37.0 F (2.8 C)</windchill_string>
<davis_current_observation>
<DID>001D0A005FE1</DID>
<station_name>Hawks Nest</station_name>
<observation_age>30</observation_age>
<dewpoint_day_high_f>41</dewpoint_day_high_f>
<dewpoint_day_high_time>12:00am</dewpoint_day_high_time>
<dewpoint_day_low_f>38</dewpoint_day_low_f>
<dewpoint_day_low_time>6:32am</dewpoint_day_low_time>
<dewpoint_month_high_f>53</dewpoint_month_high_f>
<dewpoint_month_low_f>11</dewpoint_month_low_f>
<dewpoint_year_high_f>81</dewpoint_year_high_f>
<dewpoint_year_low_f>-12</dewpoint_year_low_f>
<heat_index_day_high_f>42</heat_index_day_high_f>
<heat_index_day_high_time>12:00am</heat_index_day_high_time>
<heat_index_month_high_f>63</heat_index_month_high_f>
<heat_index_year_high_f>112</heat_index_year_high_f>
<pressure_day_high_in>29.382</pressure_day_high_in>
<pressure_day_high_time>8:00am</pressure_day_high_time>
<pressure_day_low_in>29.313</pressure_day_low_in>
<pressure_day_low_time>12:36am</pressure_day_low_time>
<pressure_month_high_in>30.650</pressure_month_high_in>
<pressure_month_low_in>29.313</pressure_month_low_in>
<pressure_tendency_string>Steady</pressure_tendency_string>
<pressure_year_high_in>30.775</pressure_year_high_in>
<pressure_year_low_in>29.313</pressure_year_low_in>
<rain_day_in>0.1000</rain_day_in>
<rain_month_in>2.9000</rain_month_in>
<rain_rate_day_high_in_per_hr>0.1100</rain_rate_day_high_in_per_hr>
<rain_rate_day_high_time>1:37am</rain_rate_day_high_time>
<rain_rate_hour_high_in_per_hr>0.0000</rain_rate_hour_high_in_per_hr>
<rain_rate_in_per_hr>0.0000</rain_rate_in_per_hr>
<rain_rate_month_high_in_per_hr>0.4600</rain_rate_month_high_in_per_hr>
<rain_rate_year_high_in_per_hr>82.2900</rain_rate_year_high_in_per_hr>
<rain_storm_in>0.6200</rain_storm_in>
<rain_storm_start_date>12/4/2018</rain_storm_start_date>
<rain_year_in>54.0700</rain_year_in>
<relative_humidity_day_high>96</relative_humidity_day_high>
<relative_humidity_day_high_time>12:00am</relative_humidity_day_high_time>
<relative_humidity_day_low>93</relative_humidity_day_low>
<relative_humidity_day_low_time>6:32am</relative_humidity_day_low_time>
<relative_humidity_month_high>98</relative_humidity_month_high>
<relative_humidity_month_low>44</relative_humidity_month_low>
<relative_humidity_year_high>98</relative_humidity_year_high>
<relative_humidity_year_low>24</relative_humidity_year_low>
<relative_humidity_in>31</relative_humidity_in>
<relative_humidity_in_day_high>31</relative_humidity_in_day_high>
<relative_humidity_in_day_high_time>1:22am</relative_humidity_in_day_high_time>
<relative_humidity_in_day_low>30</relative_humidity_in_day_low>
<relative_humidity_in_day_low_time>12:00am</relative_humidity_in_day_low_time>
<relative_humidity_in_month_high>37</relative_humidity_in_month_high>
<relative_humidity_in_month_low>22</relative_humidity_in_month_low>
<relative_humidity_in_year_high>56</relative_humidity_in_year_high>
<relative_humidity_in_year_low>20</relative_humidity_in_year_low>
<sunrise>7:49am</sunrise>
<sunset>5:10pm</sunset>
<temp_day_high_f>41.5</temp_day_high_f>
<temp_day_high_time>12:00am</temp_day_high_time>
<temp_day_low_f>39.6</temp_day_low_f>
<temp_day_low_time>7:54am</temp_day_low_time>
<temp_month_high_f>65.0</temp_month_high_f>
<temp_month_low_f>13.2</temp_month_low_f>
<temp_year_high_f>94.0</temp_year_high_f>
<temp_year_low_f>-8.0</temp_year_low_f>
<temp_in_day_high_f>70.1</temp_in_day_high_f>
<temp_in_day_high_time>8:55am</temp_in_day_high_time>
<temp_in_day_low_f>67.2</temp_in_day_low_f>
<temp_in_day_low_time>4:48am</temp_in_day_low_time>
<temp_in_f>70.1</temp_in_f>
<temp_in_month_high_f>71.8</temp_in_month_high_f>
<temp_in_month_low_f>64.2</temp_in_month_low_f>
<temp_in_year_high_f>80.0</temp_in_year_high_f>
<temp_in_year_low_f>60.0</temp_in_year_low_f>
<wind_day_high_mph>17.0</wind_day_high_mph>
<wind_day_high_time>4:56am</wind_day_high_time>
<wind_month_high_mph>26.0</wind_month_high_mph>
<wind_ten_min_avg_mph>8.0</wind_ten_min_avg_mph>
<wind_ten_min_gust_mph>13.0</wind_ten_min_gust_mph>
<wind_year_high_mph>39.0</wind_year_high_mph>
<windchill_day_low_f>34</windchill_day_low_f>
<windchill_day_low_time>4:40am</windchill_day_low_time>
<windchill_month_low_f>10</windchill_month_low_f>
<windchill_year_low_f>-18</windchill_year_low_f>
</davis_current_observation>
<time_to_generate>0.010426 seconds</time_to_generate>
</current_observation>
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version