Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

xAP interaction

Questions and comments specific to a particular plugin should go here.
EdgarAuto
Posts: 6
Joined: Wed May 08, 2013 10:42 pm

Re: xAP interaction

Post by EdgarAuto »

Hey guys,

I just want to give you a shout out in support of the xAP plugin! Awesome! I use Housebot and also xAP for various things. I love that you are working on an EG plugin!

Glad to see xAP is not dead!

v/r

Kevin
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: xAP interaction

Post by kgschlosser »

this plugin was going to be geared directly twords the squeeze box, but I guess i can see if i can make it more open ended.

i do know that xAP is a standard of delivering information, not what the information is or what to put into the "message" if you will.

that is item specific, so i am thinking this will be an xAP Plugin, that os the core of sending and receiving, and then make another plugin that uses this one to send the information and receive the information.

the xAP protocol is a broadcast message and if the message is intended for that kind of device it is opened and read, i can kinda wire it the same way.

being that when it receives the message it will look to see what plugins are installed and and then shoot the message to those plugins to process the data, if the data is intended for that plugin it will trigger the appropriate event, if not it will just discard it.

K
If you like the work I have been doing then feel free to Image
V_J
Experienced User
Posts: 165
Joined: Tue Mar 04, 2014 9:00 am

Re: xAP interaction

Post by V_J »

I would consider it very generic, similar to the xPL plugin, where an incoming message is processed so it can be parsed via a script in EG.

A nice general option would be to make an action that takes as parameters the name of the source, target and block in the xAP message (user provided) and provides the content of that block. It would be easy to use for both squeezebox and general usage...

Sending a message could be like in xPL...
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: xAP interaction

Post by kgschlosser »

exactly what i was thinking, but also adding the ability for it to scan the list of installed plugins so that if it finds one that's in it's list to communicate with it will do it directly so you get something that can be added onto via other plugins as well as the ability for it to have messages sent to and from a specific plugin without all the added tree stuff,

have that feature of it able to be turned off of course just in case someone wants to see all the events and make their own links to the plugin

don't know why someone would want to do that but there are some odd birds out there

i just recently discovered there is a container in EG and it holds all of the plugins and that could be used to tell the xAP plugin what's installed and what to communicate with, and if it's not to just trigger a generic kind of event for it.



K
If you like the work I have been doing then feel free to Image
V_J
Experienced User
Posts: 165
Joined: Tue Mar 04, 2014 9:00 am

Re: xAP interaction

Post by V_J »

Finding a plugin to communicate with seems complicated... why not achieve it via variables in eventghost? That way, if the other plugin changes and does not work the same, it may be easier to diagnose and modify accordingly...
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: xAP interaction

Post by kgschlosser »

it's really not.

Code: Select all

try:
    self.xAP_Plugin= xAP(self)
except:
    self.xAP_Plugin = False

if self.xAP_Plugin:
    **do some code here for sending commands to the server**
really simple actually
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: xAP interaction

Post by kgschlosser »

well see that's the thing, we make the core of it, and release an API with it.

if someone wants to talk to it they have to make it work. not us.

we can provide a config panel mechanism for them to key in the class name of their plugin (i already have the code done up for it)

so if something comes in that can be processed by their plugin, the core can just pass it off to them.

the only reason i am thinking this way is because of the number of devices that can be added for eg support, very easily at that point. or it can even be done with some simple scripting.

it just opens the door for other devices to be supported through plugins (i don't think alot of people that want to use EG actually know how to code in python, or are even willing to learn)

it's very intimidating when you first open it trying to figure it all out. and then to mention programming to really achieve what you want.

most people don't want to spend the time to learn it (not knowing the power of EG) they like the simple easy route. so the more plugins available for device and function control the easier EG becomes to use.
If you like the work I have been doing then feel free to Image
V_J
Experienced User
Posts: 165
Joined: Tue Mar 04, 2014 9:00 am

Re: xAP interaction

Post by V_J »

kgschlosser wrote:if someone wants to talk to it they have to make it work. not us.

we can provide a config panel mechanism for them to key in the class name of their plugin (i already have the code done up for it)

so if something comes in that can be processed by their plugin, the core can just pass it off to them.

the only reason i am thinking this way is because of the number of devices that can be added for eg support, very easily at that point. or it can even be done with some simple scripting.

it just opens the door for other devices to be supported through plugins (i don't think alot of people that want to use EG actually know how to code in python, or are even willing to learn)
Sounds a nice approach... I was thinking more simplistically, mainly because my Python skills are very limited. I managed to expand the Marantz Serial plugin with more functionality for my purposes, but that was just understanding the code and adding similar code to it. I felt I could do something similar with the xPL plugin to suit my purpose, but it would not be a well coded piece... :)
kgschlosser wrote: it's very intimidating when you first open it trying to figure it all out. and then to mention programming to really achieve what you want.

most people don't want to spend the time to learn it (not knowing the power of EG) they like the simple easy route. so the more plugins available for device and function control the easier EG becomes to use.
Yes... I am trying to integrate several things, and there are so much things that I need to learn, as they have different protocols, interfaces and so on. I finally got a good idea on what I want and how to achieve it, and am working towards that goal step by step: knx-loxone integration almost done (just dimmer and temperature settings), loxone-squeezebox integration almost done, squeezebox-EG integration ongoing and Loxone-EG ongoing... Using the Squeezebox for universal IR reception is still something I need to figure out. :)


BTW: you managed to install the projector? And survived the mother-in-law? :lol:
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: xAP interaction

Post by kgschlosser »

]geesh this weekend was crazy.

my dog had to have emergency surgery and mother in law is a pain in the ass and her husband is alittle wierd.

my other dog (little chiuaahw) whatever keeps on attacking him and trying to do the deed, and he's all kinds of freaking out.

my bulldog was in really bad shape it was CRAZY!!!!

i managed to get the frame build for the screen, and get the screen all grommeted with the fabric wrapped around steel bars that do all the way around the screen.

the grommets went through 2 layers of screen material and are holding the bar tight.

i also tipped the screen material as not to get moire, (was a pain to make sure i could get the most angle with the smallest amount of fabric)

i laces it to the frame with 3/8" shock cord all the way around grommets were every 4"


this thing when i tightened it pulled the fabric so tight i could bounce a quarter off of it easily. i cut the screen for a viewable 100" and now i have a viewable 103"

LOL

border is only going to be around an inch to an inch and a half wide

i tried the projector out. it's AMAZING!!!
IMG_0065.JPG
IMG_0062.JPG
IMG_0061.JPG
If you like the work I have been doing then feel free to Image
V_J
Experienced User
Posts: 165
Joined: Tue Mar 04, 2014 9:00 am

Re: xAP interaction

Post by V_J »

Sorry to hear about the dog... hope everything will fine.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: xAP interaction

Post by kgschlosser »

thanks he is doing much better now.
but hey i was digging into the xAP protocol. it's pretty much a dead protocol.

go looking at the links for things on their webpage.

about 90% of them are dead links.

and if it's just the squeeze box you are interested in controlling. then you run the Logitech Media Server

there is a guy who made a python script for connecting to the LMS via telnet and has 2 way data with any of the devices connected to the LMS you even have the ability to change what is on the display of the squeezebox and you can imitate an exact remote button press if ya like

it would be pretty easy to port over to EG. it would just be a hell of alot of actions to add. and you would also have to make one hell of a nice config for control and displaying the information

that would be the hardest part.

but otherwise it looks pretty simple to port, it uses modules that are included in EG's python library

it's called PyLMS

and it's open source and give the guy props for writing it, and we can port it.

each of us select a section to tackle, it's just adding the actions for the majority of them no config dialogs for the actions because alot are just for returning data. i would even consider using the to add the actions that way because you can specify what function the action goes to.

just a thought.

because alot of the link i went to to get some more information about the xAP protocol just aren't there it seems as tho it's vanishing

and to be honest the vendor list is very small can't be that much out there that runs it.

K
If you like the work I have been doing then feel free to Image
V_J
Experienced User
Posts: 165
Joined: Tue Mar 04, 2014 9:00 am

Re: xAP interaction

Post by V_J »

I know it is an obsolete protocol, but it is the easiest way I can send information from the Squeezebox to my home automation server (loxone). It has the benefit that if something changes on the squeezebox (e.g. new track starts), it sends a notification via xap. No need to poll LMS. All other means will resort to some polling mechanism to know the changes. LMS also supports xpl, for which EventGhost has a plugin, but LMS sends less info via this protocol. I looked into the EventGhost xpl plugin, and it seems to me that with not much modification it can be adapted for xap. I agree it is pointless to make a full blown plugin for this; all it needs to do is receive the packet (listen on the correct port) and parse the input (apart from some fields that are added, this is same structure as for xpl).
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: xAP interaction

Post by kgschlosser »

ok... i just don't know where to find the information on the squeezebox for the message contents to be able to parse it.

are you familiar with LMS??

if so i have a Hyper-V Desktop you can connect to and you could install it there and get that all running proper so i can pull the message body and start breaking that apart to see what we can find.

now the messages are broadcast so they are probably UDP which is cool because i just changed up the broadcaster plugin and fixed a new issues with it. gave me alittle brosh up and the code most likely i could use some of the code from that for the receiving part.

i am going to poke into the xpl plugin and see what's going on in it.

K

message me if you think you could get that LMS server running (need to have that so it can send out the broadcasts)
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: xAP interaction

Post by kgschlosser »

ok i have LMS running as well as a squeeze player and they are on different machines.

i have a start on a plugin for the xAP

Receiving thread is good, working fine i have tested the UDP

i set it to the specified port in the API documentation for the xAP protocol.


but. i get nothing... no data i tried sending UDP broadcasts on that port and it receives fine.

I get nothing from the squeeze player and nothing from LMS

i did notice that Logitech is not in the vendor list on the xAP site, maybe they dropped support for it in recent versions??
i really don't know where to go from here

i would like to move forward with this but i have no idea how to proceed

i need to have something that can produce the xAP broadcasts so i make sure i have everything set right.

and I am not sure if anything is going to respond properly to a broadcast sent by this plugin because the vendor ID that is located in the xPL is not in the xAP vendor list nor do I have one.

i don't even know if i can apply for one. i haven't done the legwork on that side of it


if someone is able to help out that would be great. i can provice you with what i have so far for a plugin and you can install it and it will post in the EG log any broadcast it receives on the xAP port then you could copy that data into a file and send it to me. that would be a start.


that way i can make sure that i get the header structure right. there are a couple of points where it is kinda vague in the docs.

and without the ability to test. i am dead in the water

K
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: xAP interaction

Post by kgschlosser »

never mind, LMS does not have xAP, it is a 3rd party plugin that makes it possible, and i found where it is, so coding continues. i am receiving the broadcasts properly.


thing is the broadcasts hit every 60 seconds and it's the same data.

and there is a heartbeat also.

i think i am going to give an option if you want to have the heartbeat provide an event

and what is the thought on the actual data??? should i cache it and check to see if it has changed, and if it has then trigger an event???

or have it throw out an event every time it receives a broadcast (i am thinking the latter would get crazy if you have a handful of devices)
If you like the work I have been doing then feel free to Image
Post Reply