New Plugin: GhostXML

Posted on
Sat Nov 28, 2015 9:35 pm
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

New Plugin: GhostXML

Announcing the GhostXML plugin. The GhostXML plugin is maybe a little different than your typical Indigo plugin. The purpose of the GhostXML plugin is to interface with XML files (web-based or the local machine) and parse the XML to device states. If the structure of the XML file changes over time, the plugin will pick up the new structure and add the states automatically. Perhaps an example would be helpful at this point:

Create the device, select GhostXML and then the GhostXML device type.
Screen Shot 2015-11-28 at 9.09.02 PM.png
Screen Shot 2015-11-28 at 9.09.02 PM.png (68.63 KiB) Viewed 13160 times

Presently, devices have one setting. The path to the XML file. It must follow one of the two example formats.
Screen Shot 2015-11-28 at 9.09.12 PM.png
Screen Shot 2015-11-28 at 9.09.12 PM.png (49.23 KiB) Viewed 13160 times

If you're successful, you will be presented with device states that mirror the supplied XML.
Screen Shot 2015-11-28 at 9.09.30 PM.png
Screen Shot 2015-11-28 at 9.09.30 PM.png (24.53 KiB) Viewed 13160 times

There is also one Action, which allows for refreshing the data on demand. Why is that so different? Well, in a nutshell, everything is transitive (hence, the Ghost part.) If an XML node goes away, so does its state. That's it. The plugin is both simple and powerful. It's also very much in alpha, so use it at your own risk. Please post bugs and feature requests to this post. If there's enough interest, I'll ask Matt and Jay to create a permanent forum. This is just the beginning and the idea here is that this plugin would be continuously developed and supported by the community. If you're interested in contributing, please let me know.

You can download it here: GhostXML Plugin.

Cheers,
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Nov 30, 2015 4:01 pm
jay (support) offline
Site Admin
User avatar
Posts: 18185
Joined: Mar 19, 2008
Location: Austin, Texas

Re: New Plugin: GhostXML

Awesome contribution, thanks!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Dec 01, 2015 1:17 am
yassi offline
Posts: 468
Joined: Sep 06, 2015
Location: Germany

Re: New Plugin: GhostXML

Dave, thanks!

I have one error, can't check for updates (see screenshot).

yassi
Attachments
Bildschirmfoto 2015-12-01 um 08.15.59.png
Bildschirmfoto 2015-12-01 um 08.15.59.png (28.37 KiB) Viewed 13063 times

Posted on
Tue Dec 01, 2015 4:51 am
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

Thanks Yassi - sorry about the possible bug. Please try to check for updates manually (via the plugin menu) and see if that works.

Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 01, 2015 11:11 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: New Plugin: GhostXML

Hi Dave.
Interesting plugin!

I am trying to connect it with my local weather provider yr.no
They provide free weather data, and also in xml format. But I am getting the following error:

URL:
Code: Select all
http://www.yr.no/place/Norway/Vest-Agder/Vennesla/Vennesla/forecast.xml


Code: Select all
1. des. 2015, 18.08.40
  GhostXML Error                  YR.no XML - Error getting source data: 'ascii' codec can't decode byte 0xc3 in position 2022: ordinal not in range(128). Skipping until next scheduled poll.
  GhostXML                        YR.no XML updated.


Any idea?

Håvard

Posted on
Tue Dec 01, 2015 1:00 pm
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

Oh, yes. It's likely the ever intransigent Unicode error. I will have a look when I get home from work.


Sent from my iPhone using Tapatalk

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 01, 2015 2:51 pm
DrLaban offline
Posts: 53
Joined: Apr 28, 2015
Location: Norway

Re: New Plugin: GhostXML

Looks like the Norwegian Character bug that was in the Verisure Plugin :)

Posted on
Tue Dec 01, 2015 2:58 pm
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: New Plugin: GhostXML

:)

Håvard

Posted on
Tue Dec 01, 2015 8:50 pm
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

haavarda wrote:
Any ideas?

I think I've found the problem. I PM'd you a link to a version to test. Please let me know if it clears the error (it does for me, but our language settings are quite different!)

Thanks,
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 01, 2015 8:58 pm
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

DaveL17 wrote:
Thanks Yassi - sorry about the possible bug. Please try to check for updates manually (via the plugin menu) and see if that works.

Dave

Scratch all that. I forgot that I had de-linked the Github build from my personal Dropbox folder, so there is literally nothing for the plugin to check against. All users of the alpha should ignore this error for the time being. I'll look for a decent public spot to host a version tracker.
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 01, 2015 9:27 pm
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

It looks like we'll be able to host the version checker page at the github repository. This error should be fixed in the current repo and will be pushed in the next "official" alpha.
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Dec 02, 2015 12:57 am
haavarda offline
User avatar
Posts: 702
Joined: Aug 18, 2012
Location: Norway

Re: New Plugin: GhostXML

DaveL17 wrote:
haavarda wrote:
Any ideas?

I think I've found the problem. I PM'd you a link to a version to test. Please let me know if it clears the error (it does for me, but our language settings are quite different!)

Thanks,
Dave


That version works Dave. Thanks for the update!

Håvard

Posted on
Wed Dec 02, 2015 4:27 am
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

haavarda wrote:
That version works Dave. Thanks for the update!

Beautiful. Thanks for letting me know.

I'll add that change to the repo.
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Dec 13, 2015 10:37 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: New Plugin: GhostXML

Would a GhostJSON plugin be relatively easy for you to duplicate from this plugin?

I don't have a need at present, but someone was asking elsewhere (the IrrigationCaddy thread) and it looked like this would be a tidy solution?


Sent from my iPhone using Tapatalk

Posted on
Sun Dec 13, 2015 12:10 pm
DaveL17 offline
User avatar
Posts: 6739
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: New Plugin: GhostXML

howartp wrote:
Would a GhostJSON plugin be relatively easy for you to duplicate from this plugin?

Definitely. Jay suggested as much a while back, too. XML and JSON parsing are done with different utilities, but it would be fairly easy to fold that into the plugin. When I fist thought of this idea, I had imagined two plugins--but I think it would work equally well to figure out whether the user was asking for an XML or JSON on the back end and make it seamless to the user.

As they say, definitely on the to do list. :)

Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Who is online

Users browsing this forum: No registered users and 1 guest