Page 1 of 1

is this possible ? Merge different json in one device?

PostPosted: Tue Nov 21, 2017 8:35 am
by Umtauscher
Hi Dave,

as you might remember, I am using your great plugin to get json data from my Yamaha musiccast equipment.
Yesterday I stumpled upon a new API document which gives even more possibilities.
Unfortunately Yamaha has put the status variables into different functions. So if I want the complete status of a certain device I have to issue several request to the device to get all the information.
Is there any possibility to put all those custom states in one GhostXML device or asking the othe way arround is there a way to put a bunch of requests into one device?
I suppose not, but it's just a pain to have 4 ghostxml devices that all hold parts of the information for one physical device.
Just asking...
Thanks for you great plugin again.
Cheers
Wilhelm

Re: is this possible ? Merge different json in one device?

PostPosted: Tue Nov 21, 2017 8:57 am
by autolog
Umtauscher wrote:
... Yesterday I stumpled upon a new API document which gives even more possibilities.

I am seriously considering writing a plugin for Yamaha musiccast system as I now have 4 devices: NX-N500 (speakers), WXC-50 (pre-amp), and 2 x WX-010 (speaker). It will have to join the queue of things I need to complete but is getting much nearer the top. :)

Do you have a link to the API info that you can share?

Re: is this possible ? Merge different json in one device?

PostPosted: Tue Nov 21, 2017 9:17 am
by Umtauscher
That would just be great!
At the moment I have 2 Receivers RX-A2050 and RX-V481D
4 WX030
2 WX010

If you need any JSON response from those devices or any othe information I am happy to provide them.

The one I just found was this.
http://habitech.s3.amazonaws.com/PDFs/YAM/MusicCast/Yamaha%20MusicCast%20HTTP%20simplified%20API%20for%20ControlSystems.pdf
The older ones you probably already know
https://jayvee.com.au/documents/commands/yamaha/YXC_API_Spec_Basic.pdf
https://www.pdf-archive.com/2017/04/21/yxc-api-spec-advanced/yxc-api-spec-advanced.pdf

Re: is this possible ? Merge different json in one device?

PostPosted: Tue Nov 21, 2017 9:33 am
by autolog
Hi Wilhelm,
Thanks for the info - this definitely looks like a good candidate for a plugin. :D

What functions have you been using to control your Yamaha devices via scripting (not the JSON) but the user experience e.g volume up etc?

Just wondering what a good starter for 10 would be for a plugin, that could then be extended. :)

Re: is this possible ? Merge different json in one device?

PostPosted: Tue Nov 21, 2017 9:49 am
by Umtauscher
At the moment I am just switching then on and standby.
A second is to monitor if any speaker is switched on and turning on the appropriate source for Multiroom distribution.

Controlling the volume would be nice but I put that asside, because the Indigo web interface doesn't support proper sliders and clicking once for 0,5 db at a time is not my thing. :|

It would also be nice to select the source for any device, but I have no idea how that could be accomplished because (again) Indigo doesn't support any combo boxes or lists that could be used to select the available sources. And hardwiring the different sources via buttons is not so great.

So in the end, I do everything that concerns sources via the action definitions of my harmony hubs.

Re: is this possible ? Merge different json in one device?

PostPosted: Tue Nov 21, 2017 12:29 pm
by DaveL17
Umtauscher wrote:
Hi Dave,

as you might remember, I am using your great plugin to get json data from my Yamaha musiccast equipment.
Yesterday I stumpled upon a new API document which gives even more possibilities.
Unfortunately Yamaha has put the status variables into different functions. So if I want the complete status of a certain device I have to issue several request to the device to get all the information.
Is there any possibility to put all those custom states in one GhostXML device or asking the othe way arround is there a way to put a bunch of requests into one device?
I suppose not, but it's just a pain to have 4 ghostxml devices that all hold parts of the information for one physical device.
Just asking...
Thanks for you great plugin again.
Cheers
Wilhelm

Glad you continue to find uses for the plugin. Your suggestion goes beyond what the plugin was originally intended to do. While it might be possible, it would be a nontrivial exercise for sure. It would require collecting all of the JSON data from the various sources, combining it, and then parsing it as one big JSON. On the face, that might not be that bad, but ways to combine multiple sources might work for one but not another usage case.

It sounds like you might be saved by a purpose-built plugin for your hardware; that would easily be the best approach because then (beyond being purpose-built) it would allow for control and customizations that there's no way I could provide.

I'll add your suggestion to the todo list in case some epiphany comes to me, but I'wouldn't hold your breath. :D

Re: is this possible ? Merge different json in one device?

PostPosted: Tue Nov 21, 2017 1:08 pm
by howartp
Or a generic state-combiner Plugin...? :-)


Sent from my iPhone using Tapatalk Pro

Re: is this possible ? Merge different json in one device?

PostPosted: Tue Nov 21, 2017 3:02 pm
by Umtauscher
Thanks guys, I knew it was a long shot.... :D

Re: is this possible ? Merge different json in one device?

PostPosted: Tue Nov 21, 2017 7:23 pm
by jay (support)
I've often thought about a virtual device type that accepts a URL that would return JSON (no reason it couldn't be multiple URLs I suppose). You could then flatten the returned JSON into custom states (you could specify the polling frequency). Then you could then specify action URLs that would allow state substitution into the URL itself or even specify a JSON template file that would allow you to post JSON to the URL.

I think this would be the next step in allowing users to create a virtual device for things that have an API but don't have a specific plugin for them.