The Vera Community forums have moved!

Advanced => Programming => Plugins & Plugin Development => Topic started by: racarter on March 05, 2013, 02:59:01 pm

Title: O2 Joggler Plug-In
Post by: racarter on March 05, 2013, 02:59:01 pm
I've recently picked up some O2 Jogglers on eBay.  For the uninitiated these are touch-screen display devices with wi-fi.  They run Flash apps, so with some technical knowledge you can install xAPFlash on them.  I'm developing a plug-in for Vera to talk to these devices over IP, and I now have three of them scattered around the house displaying Vera statuses, controlling devices and running scenes.

If anybody is interested I'd be happy to share what I've done and send a copy of the code.
Title: Re: O2 Joggler Plug-In
Post by: akbooer on March 05, 2013, 03:42:15 pm
This sounds very cool indeed - any chance of a picture showing the displays with Vera stuff on it?  I'm sure it's worth spending a moment to document the xAPFlash installation process as well as the code.
Title: Re: O2 Joggler Plug-In
Post by: s4nup on March 05, 2013, 03:59:34 pm
I bought a joggler for this very purpose, but have no coding experience. I'd be very interested to see this and the installation instructions. Thanks
Title: Re: O2 Joggler Plug-In
Post by: racarter on March 05, 2013, 07:49:02 pm
Requirements for the Joggler end of things can be found here: www dot dbzoo dot com slash livebox slash xapflash

Once the requisite stuff has been installed on the Joggler it's simply a matter of editing the Joggler config file and my plug-in config so that they match each other, and away you go.

If you're familiar with xAP protocol you'll recognise some of the terms used in the tables, which is where you marry the Vera devices or scenes with the Joggler xAP objects.  Here's an example:

-- Status/Control Device Table

xapdevs[1]            =   {}
xapdevs[1].description      =   "Living Room Lamp"
xapdevs[1].device         =   3
xapdevs[1].scene         =   0
xapdevs[1].dservice         =   SWITCH_SID
xapdevs[1].sservice         =   ""
xapdevs[1].variable         =   "Status"
xapdevs[1].previous         =   ""
xapdevs[1].source         =   "ts15.vera.controller:relay.1"
xapdevs[1].uid            =   "FF00DB60"
   

I've attached a couple of pics so you can get an idea of how it looks.  Currently I'm just using the icons supplied in the example config, but eventually I'll change them.
Title: Re: O2 Joggler Plug-In
Post by: s4nup on March 06, 2013, 09:50:05 am
I managed to get the xAP interface loaded onto the joggler as well as the iServer (i think)

I tried amending the config.xml file with the example on the above website, but it doesn't look as if anything is changed.

Like i said, i'm not a coder...i understand html and xml to a degree, but i'd love some more help on this.

Thanks
Title: Re: O2 Joggler Plug-In
Post by: racarter on March 06, 2013, 11:06:12 am
Did you install the example file too?  Look at the section entitled 'Sample HAH UI' on the xAPFlash page (link as before).  Once you've done that you should get displays on your Joggler which look a bit like my pictures - but obviously they won't be live until you connect them to something.

When you get to that stage you'll need to install my plug-in on your Vera, but at present you need to edit the declarations in the code to match those in the Joggler config files.

To be honest I think it's a bit complicated if you have no coding skills.  Eventually I'd like to make the plug-in easier to configure, but at the moment I can't see how I could avoid users having to edit the xml files at both ends (Joggler and Vera). :(

If you're not put off I can send you the plug-in together with my Joggler xAP config files so you can study them and see how things hang together.  You should then be able to change things to match your own device numbers and get some live data on the Joggler displays.  PM me your e-mail address if you're still interested.
Title: Re: O2 Joggler Plug-In
Post by: s4nup on March 06, 2013, 04:25:29 pm
Ok, installed the sample HAH UI (had to tweak various bits of the XML, likconfig pathe the IP address of the server was set incorrectly as was the config path)

I've now got the same screen that you had in the screenshots so must have done something right!

I'm now ready to get to the next stage. I tried PM'ing you but it came up with an error message saying i didn't have access to that resource...is there a minimum post count before i can pm? how many posts is it?
Title: Re: O2 Joggler Plug-In
Post by: holden86 on March 12, 2013, 04:36:37 pm
I hope this is the right place to post this.

I am looking for a plugin that supports xAP. Currently, I am looking into HA and I came across this video (http://www.youtube.com/watch?feature=player_embedded&v=zB7QEFCR1Zk), about using the MS Kinect to do some automation.

I want to combine the VERA system and the Nitrogen Logic - Depth Camera Controller. I emailed them and they said it is possible, but I would need a plugin that supports xAP.

Can I use the plugin used here for the O2 Joggler? Can someone point me in the right directon?

Thanks
Title: Re: O2 Joggler Plug-In
Post by: racarter on March 12, 2013, 04:49:10 pm
s4nup and holden 86 - I've PMed you.
Title: Re: O2 Joggler Plug-In
Post by: s4nup on March 12, 2013, 05:13:44 pm
Got the message. Will be doing this tomorrow. Will updat you as to how I get on! Thanks !
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on March 30, 2013, 07:34:12 am
This works really well. It does take a bit of effort to set up the xAP configuration for the Joggler to show the buttons and variables you want but, if you are not afraid of editing xml files, it isn't so tough. WinSCP is a valuable tool for loading and editing files on the Joggler.

Once you have done that, you edit Alan's I_XAP.xml file to link xAP sources to Vera devices, variables and scenes through tables. Then you upload this and three other files to Vera (Apps, Develop Apps, Luup files, Upload...), create a Joggler-Comms device, reload and watch it spring into life.

If you are comfortable editing xml files - or want to become so - this may take a little while but it is configuration rather than programming. You can, if you wish, add-to or adjust the Lua for special requirements but that is not essential to get a working remote control.

The attached photo shows one of my units with a pop-up display of WeatherUnderground information. It also shows the alarm setting for a VirtualClock plugin that I use to trigger my heating when I need to get up early the next day. There are four buttons that allow me to set the alarm time in one hour and 15 minute increments (by running MCV scenes with a few lines of Lua in them).

The result does just what I wanted, didn't cost much and is definitely worth the effort.  8)
 
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on March 30, 2013, 07:53:08 am
If you are planning to have a go with this, I recommend a free Windows program called xFx Viewer:  http://www.erspearson.com/xAP/xFx/viewer_main.htm (http://www.erspearson.com/xAP/xFx/viewer_main.htm)

This monitors and displays all xAP traffic on your system so can be invaluable for tracking down problems (like when buttons don't do what you want or variables don't update correctly). If you are using Alan's plugin, edit the following line in I_XAP.xml to stop xFx marking Vera heartbeats as errors:

From:
Code: [Select]
local vera_source = "ts15.vera.controller"
To:
Code: [Select]
local vera_source = "ts15.vera.controller:host"
Note: xFx Viewer V3.3 has a built-in xAP hub which allows you to run more then one xAP application on your PC simultaneously. xFx Viewer V4 has an improved user interface but does not, apparently, include a built-in hub. The same site offers an xAP hub (xFX-Express Hub) which runs as a service. When I run this on my Win7-64 PC, it breaks internet communications - including the Vera UI - so I have had to disable it. I have discovered, though, that I can run xFx Viewer V3.3 and xFx Viewer V4 at the same time with V3.3 acting as the hub and V4 providing the more-comprehensive display.  There's always a way...  ;D
Title: Re: O2 Joggler Plug-In
Post by: racarter on March 30, 2013, 09:19:50 am
Rex

Great to hear you've got it all working!  I think the Joggler with xAP is a great combination for a Vera interface, and limited only by your imagination.  Pretty cost-effective too, since they usually go for less than ?50 on eBay.

One thing I'd really like to do is to have Vera sound an alarm on the Joggler, but I haven't figured out how to do this yet.

Alan
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on March 30, 2013, 09:56:54 am
Yes - I saw your unanswered post on the Automated Home xAP forum - which doesn't seem to be too active. It would be a useful feature. If I figure-out how to do it I'll let you know.
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on March 30, 2013, 01:50:27 pm
I play sounds on my Windows UI for Vera using VLC Media Player which accepts http commands. I wonder if this would also work on Joggler?  I see VLC is available for Linux and Ubantu so it could run on Joggler although I don't know how to install it.
Title: Re: O2 Joggler Plug-In
Post by: racarter on March 30, 2013, 06:26:58 pm
The most favourable solution from my point of view would be to add the functionality to xAP Flash so you could play a sound using a xAP command.  I was hoping that the developer might respond on the Automated Home forum, but no such luck.
Title: Re: O2 Joggler Plug-In
Post by: parkerc on April 06, 2013, 03:19:56 am
Big thanks to @racarter for a few pointers last night, and the xAP Config error I was having is now gone and I have the example dashboard that @racarter shared.

Next steps are to configure it, and as I do this, I'm wondering as many of us may be doing simular things to these files maybe we could pool certain updates, maybe adding them to a master set of files?

For example, starting with the i_XAP services, there are going to be quite a few more people will want to add.

Code: [Select]
    local   JOGGLER_SID         =   "urn:micasaverde-com:serviceId:HaDevice1"
    local   TEMPERATURE_SID      =   "urn:upnp-org:serviceId:TemperatureSensor1"
    local   HUMIDITY_SID      =   "urn:micasaverde-com:serviceId:HumiditySensor1"
    local   POWER_SID         =   "urn:micasaverde-com:serviceId:EnergyMetering1"
    local   SWITCH_SID         =   "urn:upnp-org:serviceId:SwitchPower1"
    local   HOMEAUTO_SID      =   "urn:micasaverde-com:serviceId:HomeAutomationGateway1"
    local   HEATMISER_SID      =   "urn:ra-carter-com:serviceId:Heatmiser"

Then I (think i) can see we have a standard device entries (e.g Temp below) in the I_XAP.xml which i take i you only need to change the .device ID to one you have.

Code: [Select]
    xapdeva[1]               =   {}
    xapdeva[1].description      =   "Outside Temp"
    xapdeva[1].device         =   88
    xapdeva[1].dservice         =   TEMPERATURE_SID
    xapdeva[1].variable         =   "CurrentTemperature"
    xapdeva[1].previous         =   ""
    xapdeva[1].source         =   "ts15.vera.controller:1wire.1"
    xapdeva[1].uid            =   "*"

Which has a corresponding entry in the XAPcnfig.xml

Code: [Select]
      <button NAME="Temp">
         <gridX>2</gridX>
         <gridY>0</gridY>
         <label>
            <text>Outside</text>
            <fontcolour>0x000000</fontcolour>
            <offset>-20</offset>
            <fontsize>20</fontsize>         
         </label>
         <bsctext>
            <fontcolour>0x000000</fontcolour>
         </bsctext>         
         <style>outside-temp-icon.png</style>         
         <xAP>
            <schema>xAPBSC</schema>
            <uid>*</uid>
            <source>ts15.vera.controller:1wire.1</source>
         </xAP>
         <mode>text</mode>         
         <hide>state</hide>
      </button>

When I get to pages and pop ups that's the area I'm still getting head around, plus I'm keen to change the buttons/icons and where possible it would be good to use the native Vera ones.


Great job, my girlfriend thanks you (through clenched teeth) Alan :)
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on April 06, 2013, 05:18:23 am
Watch-out for device numbering in the source names as your usage grows. E.g. "ts15.vera.controller:1wire.1" or "ts15.vera.controller:relay.1". The way it is currently implemented, ...relay.10 to ...relay.19 will be matched to ...relay.1 with sometimes interesting results.  :o  Likewise with ...1wire.1x.

The simple solution is to use two-digit numbers (relay.00, relay.01, ...) in both I_Xap.xml and xapconfig.xml.
Title: Re: O2 Joggler Plug-In
Post by: parkerc on April 06, 2013, 05:31:39 am
Thanks Rex,

That sort of information helps a lot, also I noticed that you had implemented some other features too.

A pop-up display of WeatherUnderground information. It also shows the alarm setting for a VirtualClock plugin that I use to trigger my heating when I need to get up early the next day. There are four buttons that allow me to set the alarm time in one hour and 15 minute increments (by running MCV scenes with a few lines of Lua in them).

Would you be able to share those as I have both of those plugins running too.?

It's already becoming very obvious that you really need to plan how you want the screeen to look and feel in advance.. Maybe One for the future would be a piece of code that maps your current Vera (room) categorisations to the Joggler XAP xmls.

Thanks again Rex - Keep those nuggets coming.. ;)
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on April 06, 2013, 06:31:31 am
Quote
Would you be able to share those as I have both of those plugins running too.?
I've PM'd you.

Quote
It's already becoming very obvious that you really need to plan how you want the screeen to look and feel in advance.
Well, in theory, you should always plan things thoroughly before you start. The thing is, until you get a feel for how it all looks and behaves, that isn't always possible. Anyway, that's always been my excuse for leaping into the code as soon as the ready-light comes on.  ;D

I did find it necessary to move buttons and text-boxes around the screen and between pages as I built it up. That isn't too hard, though - just changes to row & column indices and cut/paste between pages. WinSCP is a great tool for this job. It has enough of an edit function to directly change the xapconfig.xml file on the Joggler. Then you can just quit and restart the xAP app to see the results. Not exactly WYSIWYG but fast enough.
 
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on April 06, 2013, 06:59:05 am
Once you get the spadework done, expansion is fairly straightforward: My new Joggler was re-flashed and online about thirty minutes after the postman delivered it. No changes were required at Vera's end of the pipe.

There is one thing that has, so-far, defeated me. How can I get xAP to auto-start when the Joggler boots? My fumblings in /etc/init.d/rcS have not born fruit. I'm not sure which is smaller: my knowledge of Linux or my understanding of Flash but this isn't helping. Googling hasn't helped either. Answers to questions about Linux seem to assume that the recipient is intimately familiar with the most-arcane parts of every flavour of the system - and is < 18.  :)  Did you manage to achieve this, Alan?
Title: Re: O2 Joggler Plug-In
Post by: racarter on April 06, 2013, 08:00:00 am
Rex

I must admit I hadn't looked at auto-starting xAP on the Joggler but I imagine it should be feasible.  I'll have a look.

Alan
Title: Re: O2 Joggler Plug-In
Post by: parkerc on April 07, 2013, 02:42:29 am
Hi

Quick question, in the current xapconfig.xml there only looks to be one <layout > defined (8x4) is it possible to define a different layout per page?

For example lets say I want a 1x1 grid layout on one page and 4x2 on another ?

Also, is there any reason why I can't run Ser2net on the Joggler?
Title: Re: O2 Joggler Plug-In
Post by: racarter on April 07, 2013, 04:15:21 am
Chris

I don't see any reason why different-size grids shouldn't work.  Why not experiment on Page 4?

Not sure about ser2net on Joggler. I guess if Busybox supports it then it should be feasible.
 
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on April 07, 2013, 04:27:17 am
The xAPFlash guide shows the Layout parameters at the instance level and not as an override under the Page parent so it may not work. I use the posX and posY fields to position items off the layout grid.

Does ser2net work if you run it in a putty shell?
 
Title: Re: O2 Joggler Plug-In
Post by: parkerc on April 09, 2013, 02:42:57 am
Hi Rex, i've not had chance to play with Ser2net yet, but i might not need it now.

At the moment I'm still trying to build my I_XML file and I'm still getting my head around the xapconfig for the screen layout (sadly I have so little time to play at the moment)

The current plan is to have 4 pages

1) Temp & Power
2) Security
3) lights
4) Sonos (if I can work it out)

* I'm looking to see if I can create a page of buttons for the rooms I have, which once pressed would then pop up a sub page that has the values, but I'm not sure if a pop up works off of a button and must come off the menu (if you know what I mean)

Just to confirm the build on my Joggler, I'm running the (customised) OpenPeak firmware 30303 with the PNPIII customisation.

@racarter - Would it be possible to send Luup code to Vera, rather than have to create a scene everytime and have to point to that? If not code then a structured Luup http request (http://wiki.micasaverde.com/index.php/Luup_Requests)

PS - I found a free XAp viewer on the iphone which shows me what messages are being transferred form Vera (i assume) which helps me see what I have set up correctly, plus it looks like it can also simulate commands too. (XAP does quite a few things, for example tts.speak interests me too)
Title: Re: O2 Joggler Plug-In
Post by: racarter on April 09, 2013, 04:21:06 am
Chris

I know of no way the Joggler could send code to Vera, unless someone could develop a completely new Flash app to replace or augment xAP Flash.
Title: Re: O2 Joggler Plug-In
Post by: parkerc on April 11, 2013, 11:27:33 am
Hi @racarter

Do you have a plan (a roadmap) for this plug in ? Where do you see it going ?

Putting the Joggler to one side - having a general xAP integration with Vera is certainly an interesting prospect, admittedly I'm still reading up on it all so I'm nowhere near an expert - but I like the concept and potential of the plugin maybe broadening itself out in the future - maybe enabling notification/screen updates on TiVO, tts.speak, X10 control etc., all seems like there possible

This thread has mentioned about working in the XML directly and I agree, it would be nice one day if the plugin maybe had a tab that allowed you to enter in the devices and the variables you wanted to send to the Joggler

I will however admit that the xAP flash set up on the Joggle is not going as well as i'd hoped - some questions for you below

1) I can't seem to get the text (label or value) to go into the centre (I've tried offset) etc.
2) It does not seem possible to make a Status Icon change - e.g for a motion sensor - show tripped/not tripped
3) Where can I change the refresh/update period ? I can see potential places in the I_XAP.xml but am not sure ?
4) Is it possible to create a label that shows on a page when a device or a page was last updated ?
5) the background used has white lines on either side, which suggests it is fractionally too small - do you see that too ?

Hope you don't mind me sharing.. :-)
Title: Re: O2 Joggler Plug-In
Post by: racarter on April 11, 2013, 12:50:00 pm
Chris

I wrote the plug-in for myself, to satisfy my current needs, which it does - so there's no road map.  Having said that I'd be happy to develop it further if I (or other users) had specific requirements.  I just shared it here in the hope that others would find a use for it.

In response to your other points:

1) I've tried too, as have others, without success!
2) If you use glossy_button_off_.png as your status icon the button will change from red to green when the status changes.
3) Updates are currently 20s for analogue/text objects and 3s for statuses.  You can change these figures by altering them in the luup.call_timer statements in functions updateAnalogues() and updateStatuses().
4) You can use a text box for this.  There's one already set up for SMS use which I've now used to report my security alarm status.
5) I've noticed this too, but I suspect it's a feature.  There are alternative backgrounds available here: http://www.dbzoo.com/livebox/xapflash but they'll probably have a line too.  You could experiment with slightly larger images but I'm not sure if they'd work.

I think that it would be necessary to involve the developer of xAP Flash to address some of the issues you mention, but he seems to be unavailable so I suspect we're stuck with what we have.
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on April 11, 2013, 01:42:37 pm
I recently reverse-compiled xAPFlash to see if I could find any in-built mechanism for playing sounds. So far, apparently not although it does have the ability to sound a chime and oops sound - when I can figure out how to trigger it.

It's a fairly sizable chunk of code but, given enough time and patience, it must be possible to fix some of the bugs even if the designer has gone offline. It would be a task best suited to someone versed in Flash...
 
Title: Re: O2 Joggler Plug-In
Post by: parkerc on April 11, 2013, 05:55:27 pm
Hi @racarter

I was just checking the logs and I noticed that i have a number of errors coming up, which are not  clear what the cause is, but I was wondering if they might be related to your plugin. Can you confirm?

Quote
50   04/11/13 22:50:14.149   luup_log:56: WOLPlusPing Ping Enabled, executed <0x2e131680>
01   04/11/13 22:50:14.522   GetLuaInterface can't find device type: 3/0x114d4c0 str: 3 <0x2f731680>
01   04/11/13 22:50:14.522   luup_variable_get interface 0x114cb70 args 3 <0x2f731680>
01   04/11/13 22:50:14.523   GetLuaInterface can't find device type: 3/0x114d4c0 str: 81 <0x2f731680>
01   04/11/13 22:50:14.523   luup_variable_get interface 0x114cb70 args 3 <0x2f731680>
01   04/11/13 22:50:14.524   GetLuaInterface can't find device type: 3/0x114d4c0 str: 27 <0x2f731680>
01   04/11/13 22:50:14.524   luup_variable_get interface 0x114cb70 args 3 <0x2f731680>
01   04/11/13 22:50:14.525   LuaInterface::CallFunction_Timer-5 function updateAnalogues failed [string "..."]:509: bad argument #5 to 'format' (string expected, got nil) <0x2f731680>
06   04/11/13 22:50:22.221   Device_Variable::m_szValue_set device: 111 service: urn:futzle-com:serviceId:CurrentCostEnviR1 variable: Version was: CC128-v1.29 now: CC128-v1.29 #hooks: 0 upnp: 0 v:(nil)/NONE duplicate:1 <0x2ffb5680>
Title: Re: O2 Joggler Plug-In
Post by: racarter on April 12, 2013, 07:25:12 am
I'm not sure what those errors are but they don't stem DIRECTLY from the plug-in, apart from the empty string message which indicates something's not getting through, presumably due to the preceding device error messages.  The numbers 3, 81 and 27 look like device numbers to me.  Are they device numbers you use, and are relevant to Joggler comms?  If so, are the devices correctly set up, both in Vera and in the plug-in?

I assume you've made no changes to the plug-in, apart from the device tables?


Title: Re: O2 Joggler Plug-In
Post by: xAPPO on April 15, 2013, 08:01:50 am
Hi,

  I am the developer of xAPFlash. Sorry but  I was totally unaware of this thread or any pending questions until someone posted a link just now on the Automated Home forum.  I'll try my best to help you get things sorted although I don't have a micasaverde unit - much as I would like to as I hear great things.

  xAPFlash development was put on hold for various reasons which I'll expand on in a later post when I get home tonight.  Let's then have a chat about the possibilities...

Kevin
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on April 15, 2013, 10:07:18 am
Welcome, Kevin.

We are very happy to hear from you. I'm sure, with your assistance, we can make xAPFlash a really useful tool for improving the Vera UI.
Title: Re: O2 Joggler Plug-In
Post by: parkerc on April 15, 2013, 12:49:34 pm
Hi Kevin

Thanks for joining this forum. :)

i just wanted to echo what Rex said, there's some real potential with the Joggler and Vera, and your  xAPFlash/iServer interface is an intriguing one.
Title: Re: O2 Joggler Plug-In
Post by: racarter on April 15, 2013, 06:38:43 pm
Good to have you here Kevin.  Love the user name, btw!

Alan
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on April 16, 2013, 01:35:47 pm
Let's start by explaining where xAPFlash is at.  The last release beta that you're all using is pretty stable with no known major issues - although it does have a few nuances  ;) 

The XML structure suffered from a lock of planning and just evolved in a rather hap hazard way as features were added by myself and another couple of developers.  It's certainly not something I'm happy with,  but it is what it is.  The poorly designed XML configuration, relatively unknown xAP protocol  and the acquisition of a lot of relatively novice O2 Joggler users hoping for an 'automate my home' application led to a significant support headache for me with literally hundreds of emails and a difficulty trying to encourage people to use a self help forum.  As the application grew, feature requests appeared daily and I realised the support of this application was going to be too much for me.    Offering any 'free' application is always a challenge in this respect.

I also came across a user that was offering assistance in the coding, with a view to supporting different stage sized devices,  but by chance I discovered a version of the product being sold commercially by that user and realised where a lot of my support emails might be coming from  >:(  I had never wanted to protect the application against de-compilation but that seemed necessary now.  However protection on the Joggler proved a challenge as it has a non standard Flash implemenation.

A later version was being worked on but it was significantly more complex and also increasingly dependent on the Joggler / Open Peak API,  raising issues that needed manufacturer support. Dealing with O2 and/or OpenPeak proved most frustrating  with neither company feeling they should be the support contact. Several API bugs were apparent and had to be addressed or worked around and there were a lot of undocumented API's.   Then O2 suddenly discontinued the Joggler and Apple and Adobe sparred with Flash, eventually resulting in Adobe confirming that Flash had limited future.

So I took the decision to freeze the released version and just address any bugs and really hope that the existing users could pool together to help each other with config issues.  That never really happened as I had hoped it might and things gradually quietened down.  Many people had offered to write up some help guides but none appeared - with the exception of Brett's great work for the Home Automation Hub project.    I had felt that if the user community did become self supporting I might be coaxed into a further release, but it didn't.

xAPFlash was developed for the Joggler and as such makes assumptions with regard to stage sizing, grid layouts etc .  The Joggler Flash implementation is also somewhat non standard.  To offer a viable application on other platforms e.g. Browsers, Android, tablets, phones required fundamental changes in the code.  I was a complete Flash novice when I started and quickly realised that many other decisions I had made would have been much better implemented in a different way.  As I better understood Flash I also quickly appreciated the power it offered for much improved button icons with multiple states, animation, embedded Flash applets etc etc.  Flash really is amazing in many respects.  Much work was done on this and I run it myself here daily, but it has never been released, mainly as it is significantly more complex,  has XML alterations and also it required that users had a Flash development ability for the (now) SWF based button icons etc. ... oh and that awful bore ... documentation.      Making an application that suits yourself is very different to offering an application that suits or is even usable by others.

So the released version is likely where xAPFlash stays.   My memory of the application is now many years hazy and with a later version having been partially coded it will be very difficult, and  I would be very resistant to  tweaking the released code.  Even assuming that I could establish the source code used at that time.   Sorry if that's not quite what you'd hoped to hear but I hope you can now see why it's not as straightforward as it might seem.

Anyway - what I will do is try and address some of the specific questions that have been asked re the current application and I believe that you can achieve almost all the things that you might wish with that version...      I just have a little difficulty timeline wise in knowing just what was is that version as it's a while back now.  I don't believe there are any significant bugs though....  I'll post again shortly re those questions...

Kevin
Title: Re: O2 Joggler Plug-In
Post by: racarter on April 16, 2013, 02:02:04 pm
Thanks Kevin, that all sounds very reasonable - and I sympathise with your comments re application support!

Speaking for myself, xAP Flash does pretty much all I need as it stands.  The only significant addition I'd like to see is the ability to sound alerts for certain home automation events - as I've posted previously on the automatedhome forum.


Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on April 16, 2013, 02:05:42 pm
Hi Kevin,

Thanks for the explanation. I certainly understand the burden of providing support on a complex product to users of varying technical ability. It can just consume you - and for no remuneration!

The xAPFlash on the Joggler does almost everything I need - and I suspect it can also do the other things we discuss in this thread - if we but knew how to make the right request. I have tried perusing the decompiled code for clues but my Flash knowledge is not really up to that task.

I think the most common wish is to be able to play sound on the Joggler in response to some event. Text-to-speech would be wonderful but playing an existing wav or mp3 would probably meet a lot of requirements.

My peek at your code revealed some processes for notifyaural, notifyvisual and slideshow along with chimesound and woobsound but I was unable to figure out how these functions were enabled/triggered.

I personally don't expect you to attempt modifications on old code but any guidance would be really appreciated.

Rex

Edit: Great minds, Alan...
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on April 16, 2013, 07:38:54 pm
IIRC there is a secure <mode>  button tag in the released code and within that section you can select a certain sound file to be played each time
the button state transitions on/off.   The 'woob' and other sounds might be  inbuilt Joggler sound files but they can also likely  be  other pre loaded .wav resources.  If that's the case you can effectively play any sound via a xAP event that , from reading this thread,  micasaverde can originate.  I'll need a short while to double check this...

 Interaction with the Joggler sound API - and  the Joggler O2/OP SWF sliders for volume control along with a xAP API for same was one of the things we tackled.The 'play sound' functionality of the API was an example of one of those issues that caused us API concerns because there seemed to be a definite bug where sounds became garbled after a period of time. We were told there was 'no known issue' but the problem persisted.  Curiously once the OpenPeak firmware update was released, after O2 absolved themselves the problem was fixed, at least on my Jogglers .... hmm

K
Title: Re: O2 Joggler Plug-In
Post by: parkerc on April 17, 2013, 04:20:45 pm
Hi @XAPPO

I hope you dont mind, but i have a couple of hopefully quick questions for you.

1) I can't seem to get the text central on the status icons (temp reading and text are slightly to the left?)

2) Is it possible to have a different grid layout per page, (or as we think) it seems it is only possible to set that once?

Many thanks for all the background information..

Title: Re: O2 Joggler Plug-In
Post by: xAPPO on April 24, 2013, 07:54:31 am
I will look at centered text, it maybe as simple as a centre cf center tag or a more significant issue. again I know at some stage I added some offsetY and offsetX tags but I'll need to check which version.

Re the grid, it's not overridable at the page level but you can manually place any buttons at specific x,y coordinates, so select the most frequently used grid and then manually place the rest.

K
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on May 27, 2013, 11:10:25 am
Apologies for the delay but I have now looked at the centered text within the status icons and it's not an easy thing to fix.   Basically the text field is an embedded element within the button SWF and it doesn't seem to be behaving with regard to the centered attribute, nor can I get it to oblige... and so I'm afraid it will remain 'as is' but ....

Text within a text field  does center correctly and so you could achieve what you want by using one and placing it appropriately over the button icon to display the information.  You would have pixel by pixel placement of this too.

  K
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 02, 2013, 12:51:15 pm
Checking in again.. It's very quiet ....   

One thing I have managed to do is get hold of a Vera 3 that I can now try with xAP.  I'd very much appreciate it if you could send me the most recent Vera code and I'll give it a try.  I realise it's a work in progress. Unfortunately I can't PM you with my email due to the new member restrictions policy on this forum so here is an address kevinhATxapautomationDOTorg or PM me with a email address to contact the author.

Having now taken a bit of an interest in Vera it appears that it is very much being neglected by MCV so I'm guessing it's had it's day or a new model is on the horizon ? It looks like it had great potential.

K
Title: Re: O2 Joggler Plug-In
Post by: racarter on August 02, 2013, 05:58:16 pm
Hi Kevin

I've sent you the files you need, together with instructions.

Good luck!

Alan
Title: Re: O2 Joggler Plug-In
Post by: parkerc on August 03, 2013, 04:07:28 am
@XAPPO welcome to the Vera world ;)  Your journey will be both fulfilling and frustrating; 

I'm definately very fond of my unit and it's been part of my HA world for two years now.  In regards to Vera being "neglected". I think MCV have a focus more or enterprise rather than consumer these days, but if you scan through the threads in this forum you'll find some very talented and committed Vera Lovers (if I can call us all that ;)). And considering the age of the current Vera range I would expect a new updated release soon.

So anything you can bring to the table to enhance the Joggler and Vera partnershio would be great. I must admit my usage of xAP has reduced, due to the effort required to customise etc but I'd certainlylike to see the great work @racarter has already done evolve.
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 05, 2013, 11:49:21 am
I've sent you the files you need, together with instructions.

Hi Alan,

Thanks for that but they didn't arrive... apologies,  my fault I think.  Could you try again.  I think there may have been a forwarding problem with the email address I gave which is now fixed.

Anyone know how long / many posts before I get PM on this forum ?

Kevin
Title: Re: O2 Joggler Plug-In
Post by: racarter on August 05, 2013, 12:12:35 pm
Kevin

Re-sent.

Alan
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 09, 2013, 11:13:24 am
OK - I'm learning the ropes re plugin coding and LUA but I seem to be making good progress.  I have to say it is quite a battle as the available info seems very disjointed and incomplete, it's as though mcv just gave up on it after a while.   I hope not as there's great potential here. There seem to be some open technical issues too.

What I'm interested in is if anyone is already using xAP in their home automation setup, or would like to, alongside Vera ?   I'm not seeing the Joggler as really a xAP interest persay as I think xAP was just a means to a front end solution. 

Having got hold of a Vera now I may as well press it into service so I'm looking at what functionality people might want from a xAP plugin for Vera and if there are any users here or should I just persue this for my own use, which is much less time consuming.  I'm still not intending updating the Joggler Flash code though.

Here's the key aspects I think a xAP plugin should offer. 

1) Internal Vera devices should expose their status and control via xAP.
2) xAP devices should be able to be monitored and controlled from Vera.   
3) The xAP BSC schema should be fully supported
4) Configuration should be as easy as possible

Now 1) which is what the existing plugin addresses allows  you to attach any of the xAP controllers to Vera , including of course the Joggler but there are others including PC based , and there is an imminent arrival of a very capable and flexible iOS application for the iPhone/iPod/iPad. Great eye candy.   An Android solution is being worked on by someone too. 

I'm a little bit wary though as Vera is UPnP purposed and a valuable move away from specific protocol interactions and so this might be somewhat against it's raison d'etre.

4) Will take a bit of thought.....

    A big thanks to Alan as your plugin code has made my learning path so much easier.   I am interested to hear if people are still using their Jogglers as I have updated a few things (with permission)  that should improve the existing interaction, especially if you have a busy xAP network where the existing plugin would clog.   I still have a memory leak issue being reported by Vera although I think that is unrelated to the xAP plugin...   anyone else seeing it in the LUA log ?     BTW  I can now also appreciate why people are after different control  interfaces to Vera ;-)

    So let me know if there's any interest and I'll go from there,.I might post a separate xAP topic too. 

   Kevin

PS This is the xAP iPad app with a screen design created to mimic the Joggler
Title: Re: O2 Joggler Plug-In
Post by: racarter on August 09, 2013, 11:22:09 am
Hi Kevin

I'm using three Jogglers round the house to access Vera information and control things.  I use automator.app on iPad and iPhone at present, but it would be interesting to see an iPad xAP app.  Not sure how security would be handled though..?

Alan
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 09, 2013, 12:14:57 pm
I'll get a revised plugin back to you shortly Alan - kick it's tyres / tires.   
BTW Can you just confirm you don't see any memory leaks reported in the LuaUPnP.log currently ... 
I'm running xAP, Wemo, Z-Wave, Sonos , RFXCom and Sonos currently , I'll have to explore how to selectively disable these to reduce the permutations.

Security - an interesting issue I probably haven't thought through enough if you're after serious levels of protection.  I use my iPads on xAP almost exclusively on my intranet rather than externally so it's not a major issue to me.   The cloud/  proxy /external access Vera offers is a different scenario.    However...   you would have the ability to add some verification code to the LUA plugin and the iOS app has the ability to include JavaScript code  so it should be possible to add basic challenge/response authentication.  You could also for example use/pass the iOS MAC address or device UUID to the Vera for validation although it could be spoofed and there's no packet encryption. 

 I already implemented some levels of authorisation for control of each individual device (button)  by different users which I think would be fairly hard to circumvent...  In the testing phase I was trying to give people access to my network and avoid my heating being turned up to boiling point and sitting in darkness ;-)  The iOS app enforces this internally and transparently per device (button) before data is even sent to the xAP network.  Not easy to compromise as there are encrypted keys in the iOS application.

On the Internet xAP broadcast UDP  isn't viable so we actually use a device (or application) called iServer which transports xAP via TCP to your home network.  The iServer has logon passwords before any xAP traffic can be passed and , depending on the particular device / variant this password can be setup to restrict access to certain xAP devices either totally, status only or full control, i.e. enforced device filtering.   The inbuilt Joggler iServer is not as fully featured as some external ones and obviously should be run on a wired Ethernet Joggler rather than WiFi.  It's an extra step but very important to get good performance and security, and is often used for WiFi xAP devices too e.g. the Jogglers.

  Kevin
Title: Re: O2 Joggler Plug-In
Post by: racarter on August 09, 2013, 12:30:00 pm
Hi Kevin

No leaks showing in my log currently.

Alan


Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on August 09, 2013, 01:49:09 pm
I'm running four Jogglers with control/display of 10 analogue variables and 28 digital states/scenes. I run a modified version of Alan's code to improve latency but there is room for further improvement - especially following restart of Vera or a Joggler. I'm interested to see your take on this.

I do get lots of memory leaks flagged. They don't appear to be associated with any particular plugin or activity. Others have noticed the same thing and it has been raised in various posts - without any resolution, of course.  ::)

A new, easy-to-configure xAP plugin for Vera sounds good. I'm not sure I understand what the corresponding front end UI would be, though. Please tell me it wouldn't only work on iGadgets...

For my usage, display and setting of device variables, digital states and execution of scenes are the most valuable functions.
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 09, 2013, 06:50:16 pm
The fact that leaks are generally reported and not related to this plugin makes me feel better.  I can't see anything in the log that indicates this plugin contributes to those... these are the sort of thing I see...

02      08/10/13 1:41:32.000    LOG_CHECK_MEMORY_LEAK pMem start 0xdb8000 now 0xe06000 last 0xe00000 leaked 319488 <0x2b30f680>

 I did wonder about this function construct that calls itself but I'm now thinking it's OK as long as it completes in a timely fashion.  So I'll ignore this for the time being.

function heartBeat()
      luup.call_timer("heartBeat", 1, "60", "", "")
      ...code....
end


Re the latency - For messages into Vera I think I have  that sorted as the previous plugin could only handle 1 xAP message per second so things could get queued up.  Now all queued messages are handled as fast as possible and the arrival of any new ones checked every second. The socket doesn't block.  Thus the max delay should be just fractionally over a second and typical response under 500mS.

One thing I haven't yet handled is how to be notified , i.e. to send xAP events when a Vera device changes state.  I gather there is no event based callback mechanism and instead I have to monitor variable changes, AIUI by placing devices in scenes or using luup.variable_watch   I have found one forum post related to this so  I'll look at this shortly but if anyone has any code or useful info here please let me know.  This means currently there is still  latency here to eliminate.

Configuration needs attention and I need to better understand Vera and the possible options here, for example can I add my own variables into other devices, can I determine the appropriate UPnP schema usage and identify the related variables programatically....

There are many xAP front ends.. and no you're not tied only to iOS or the Joggler.  There are PC applications too as well as most HA automation software (as they nearly all have xAP plugins available).  The Android app is something I am just aware a users is working on - I haven't had an update though recently.   Often projects evolve just enough for the developer to meet their own needs but they don't bring them to a release state because that involves a lot more work... and support.  As most Android devices can run Flash - albeit with a bit of manual work then xAP Flash via a browser can work too.  If you're prepared to pay a bit for a quality front end then the cross platform (iOS/Android and maybe PC) iViewer application from Command Fusion might become a solution.  An update has just recently been made to this which should make xAP much tidier to implement.

I do notice in a lot of the developer bits that constant reference is made to being able to replace the inbuilt Vera UI with custom code and so I'm also assuming that this has been explored with an Ajax or webSockets type approach ??  Has it not  and what's out there ?

I'm looking to avoid anything that's going to consume lots of time and is Vera specific as I somehow get the feeling that we're at the end of a life cycle with this version of Vera and mcv's desire to enhance / support it further.   Also to be fair xAP has not had the adoption that we wanted and so it remains incredibly useful to those that adopt it and put the effort in but the days of evangelising for that hoped for snowball uptake are over.   UPnP is very similar in lots of ways - just orders of magnitude more complex and bulky, and hence inaccessible to hobbyist enthusiasts.

Kevin
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on August 09, 2013, 07:54:34 pm
Thanks for the response, Kevin.

Regarding the self-calling heartBeat function, you're right: As long as it returns within one minute there should be no problem.

The easiest way to get event callback is to use luup.variable_watch. See: Here. (http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#function:_variable_watch)

I am personally not convinced that UPnP is much of an asset to the way Vera works. It does seem very cumbersome and I must be missing the big advantage. I recently implemented a system with the Fibaro HC2 which uses a much simpler approach. It may be more limited in theory but in practice it works very well and does not require the overhead of UPnP. Maybe adding xAP to Vera would give better flexibility whilst retaining device independence...

Is it worth developing an xAP plugin for Vera? There are a lot of people with existing products and they are not all going to switch immediately to a new box - even assuming it is radically different to what we have now (which I doubt). You have also observed that many of us are still searching for a really good UI. There are several options but they all seem to have their drawbacks.  If you can make it possible to have a customized UI on a variety of remote platforms with simple configuration, you will make a lot of friends.  ;D


Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 09, 2013, 08:38:33 pm
Yes  luup.variable_watch seems to be working well... I'll add that functionality in now.    I'll research how to loop through all existing devices too, regardless of their UPnP schema.  I need to better understand UPnP to know which variables I need to watch for which schema but I'm sure that's do-able.  It's curious though that I don't see the value of the variables e.g Status updated when I click in the spanner/advanced tab of each device - I thought the current value would be displayed there but it never changes.  The luup.variable watch is being triggered though on change. Just working on on/off devices currently level and text later.

It would have been helpful to have a complete bidirectional IP based plugin example / tutorial to work from with a bit of UI content, buttons, sliders and text display. Most tutorial plugin threads are half completed or abandoned.  I'll find a good one somewhere but I'm slowly getting there.

I'm watching HC2 - it's a bit expensive but interesting - and a novel programming approach.  There are a lot of technical issues being posted on their forums too still so it's a way to go yet I feel... but promising.

UPnP's quite an overhead, and xAP had very similar issues to address. We took heart from the fact that with all the money, companies, people and committees that are working on UPnP to get it thus far - it still has a long way to go... So we .. as a few enthusiastic individuals had little chance flashing out our xAP schema (the ways of abstracting device functionality to a standard control framework).  Thus we are short on that side of the project implementation and focusing on simpler schema like BSC etc.  UPnP is the closest to a universal 'open' standard that might attract widespread adoption that we have though.
Title: Re: O2 Joggler Plug-In
Post by: parkerc on August 10, 2013, 02:37:23 am
Hi XAPPO

I'm reading your updates with interest and i'm curious what youre going to bring to Vera.

Just for the record I have one Joggler up and running, although my main UI of choice is HomeWave on the iPhone/iPad. Which if you've not seen it is a fantastic piece of software and hugely customisable.

Looking at the work @racarter's done, I'm wondering if there might be any updates made to Joggler & iServer, as I like the simplicity (always on) look/feel of it.  but sadly not the way it has to be customised manually via the XML , so an evolution that allowed a web UI or something to be used would be huge..

Reading your posts, do I take it the Joggler, iServer, xAP mix is not your focus and just xAP is? If so, I'm wondering if you should spin off a dedicated thread to xAP?
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 10, 2013, 07:06:49 am
Just for the record I have one Joggler up and running, although my main UI of choice is HomeWave on the iPhone/iPad. Which if you've not seen it is a fantastic piece of software and hugely customisable.

I'm brand new to Vera - and landed here really because of the xAP plugin - when I saw a Vera available I grabbed it to better understand how it all fits together.   I'm not familiar with HomeWave but I'm glad that it suits your needs ,  I was beginning to feel everyone was unhappy with external control of Vera ! Do they have ports planned for other mobile platforms like Android and Windows ?

Quote
Looking at the work @racarter's done, I'm wondering if there might be any updates made to Joggler & iServer, as I like the simplicity (always on) look/feel of it.  but sadly not the way it has to be customised manually via the XML , so an evolution that allowed a web UI or something to be used would be huge..

Yes, I too prefer the always on  approach and my own HA setup is based around embedded projects I built to achieve that using xAP.  The Joggler was a step along that path but for all the reasons mentioned in my first posts in this thread, the released version is going to be the last.  It is what it is as they say. 

The Joggler was an XML configured device and  I agree that's pretty awkward to work with plus the structure evolved in a rather haphazard way.  In hindsight a lot of things should have been done differently.  There's nothing stopping someone of course creating a companion visual design application that generated the XML needed.... if anyone thinks there's mileage in evolving the Joggler experience for Vera users.

xAP Flash actually already runs as a web browser UI too with realtime updates, so your last point above I hope is already catered for.   In fact other embedded xAP platforms like the HAH LiveBox include xAP Flash and their control interface uses any Flash capable web browser.   You still need to edit that XML though....  Or maybe you were asking for a visual layout editor implemented via a web browser application  ?  That would be a big undertaking but again - it could be done by someone if anyone's up for it , just not me !  I would assist with any needed info on the XML structure that it would need to generate though.

iServer is a different matter - it is being maintained , complete and stable,  and if you have any suggestions for enhancing that or any bug reports I'm happy to look into them..

Quote
Reading your posts, do I take it the Joggler, iServer, xAP mix is not your focus and just xAP is? If so, I'm wondering if you should spin off a dedicated thread to xAP?

I came here really to try and answer some questions on the Joggler app and explain why that project is not likely to evolve further,  not least because they were available UK only and you can't buy them anymore ...  plus there are now other devices that are far more suitable and affordable..   Flash effectively was killed on mobile platforms too.  Since then I've bought myself a Vera and am currently updating the existing xAP Joggler Vera plugin to address some issues as well as making it more general and useful  in its xAP implementation.   

But yes...as I mentioned a few posts back I will likely open a separate xAP focussed thread once the Vera/Joggler implementation works well for everyone but in the meantime I hope we're pretty much on topic still here.   xAP needs quite a bit of handholding as it potentially addresses the eternal HA thorny chestnut of allowing everything to work with everything else so it's important that at least the plugin works well before we open that thread to new adoptees.   There will be the inevitable  "so can I now connect my washing machine to my HiFi and control it from my car using Vera/xAP ?" posts  ;)   I think for most people at the moment  xAP  is just the smoke and mirrors to achieve Joggler control.

Kevin
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on August 10, 2013, 12:01:21 pm
Quote
It would have been helpful to have a complete bidirectional IP based plugin example / tutorial to work from with a bit of UI content, buttons, sliders and text display.
Not bidirectional IP but here's a link to a plugin that displays text, variables and a slider using the basic flash capabilities of the device UI: MiLightCU1. (https://docs.google.com/file/d/0BykZKwGsCBsAeVV0dllCQUxyM2M/edit?usp=sharing)

Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 11, 2013, 09:05:26 pm
Thanks - added that as an example device ... it will be most useful as I'm soon to look at creating xAP child devices for the external xAP nodes.  I need to think through how to config/manage this as I have over 800 of them - almost every control point/ possibility in my home !  So auto create everything isn't ideal.

Had just an hour or so spare today but I've managed to recover all the names, rooms and ID's from an iteration through the devices and so a lot of the configuration can be automatic now... probably a situation where you just exclude or include the devices you want by their ID.

Everything is pretty much realtime now so Joggler interaction either way (status/control) should be near instantaneous..
 
Still haven't looked into if I can append a permanent variable onto someone else's device e.g.  xAP Y/N - a checkbox would be nice.. and still only using binary SwitchPower1 but pleased that everything seems to support that.  (Well done UPnP).

It's a shame that some of the more interesting plugins seem to have had their code pulled when the members left the forum but I guess they don't want the support legacy.

K
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on August 12, 2013, 04:17:46 am
Quote
Still haven't looked into if I can append a permanent variable onto someone else's device e.g.  xAP Y/N - a checkbox would be nice..
You can create a new serviceId and state-variable in existing devices. There's even a facility to do that at the bottom of the Advanced tab. You can do it programmatically by just writing it with luup.variable_get(...). Once created there doesn't seem to be any way to remove it - short of deleting the device. I don't think a checkbox is possible - they are naturally strings so "0" and "1" are the usual binary flags.
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 12, 2013, 06:36:12 pm
Sounds like that might do what I want ...

   Does anyone know about the persistence of device ID numbers ?  Is there any situation where a device might get re-numbered , perhaps by the deletion of a lower number device and everything shuffling down or something ?  If a device is deleted does the device ID number it was using become available again to new devices you add and would it be one of the first choices for a new device ?  I there's a persistent UDN but they are necessarily quite long.

 K
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on August 13, 2013, 01:14:39 am
Device IDs are not reused if the last owner is deleted. They are, I believe, persistent unless you rebuild the configuration from factory-reset.
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 13, 2013, 05:56:14 pm
That's good.. so I'll adopt device ID's for the xAP UID.
Title: Re: O2 Joggler Plug-In
Post by: RichardTSchaefer on August 13, 2013, 06:19:59 pm
When a device ID is needed ... It scans the list and provides a device ID 1 higher than the last one found.

If you delete a plugin and re-create it immediately it will get the same device ID.
If you delete an earlier plugin and create a new one ... The old device ID will be lost ... unless you delete all the plugins that have a higher device ID.
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 16, 2013, 06:09:29 pm
   Possibly a silly Q but as I iterate through the devices how do I find out all the services that the device supports  (and which variables are used / updated by that service) ?   I expected there to be a luup function: service_by_device or similar that returned a table.
I know this isn't the best thread to post such a Q in.

K
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on August 16, 2013, 07:01:39 pm
Your best bet is probably user_data2.

See: http://<VeraIPaddress>/port_3480/data_request?id=user_data2&output_format=xml (http://<VeraIPaddress>/port_3480/data_request?id=user_data2&output_format=xml)
or http://<VeraIPaddress>/port_3480/data_request?id=user_data2&output_format=json (http://<VeraIPaddress>/port_3480/data_request?id=user_data2&output_format=json)

Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 16, 2013, 07:29:07 pm
 At the risk of sounding somewhat masochistic.. ouch .. thank you ...

  That's a hefty bit of extra code to parse and extract  that ... albeit it only has to run at startup.   I had seen some other http accessible pages I could access that had similar info but I had expected there would be a more manageable luup function....

  I'll have a look around and see if there are inbuilt helper functions  to recover tag values from XML or some JSON stuff.  The content does have all the info I need... and more ;-)

K
Title: Re: O2 Joggler Plug-In
Post by: parkerc on August 17, 2013, 03:12:23 am
Not sure if you've seen this, or if it was of any use..

http://wiki.micasaverde.com/index.php/UI_Simple
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 22, 2013, 01:07:41 pm
Just a brief update.   If anyone want's to be involved in the testing with their Jogglers - or just with xAP then give me a shout.  It should now work much faster and totally dependably with your Jogglers.

I'm still thinking through the ease of configuration as I get to know Vera better but essentially you can just alter a xAP variable associated with each device to xAP enable/disable it , or you can xAP enable all Vera devices.  I need to think through devices beyond the basic on/off/dimmable lights and how they are best presented.  Existing xAP devices on your network will 'auto create' in Vera

xAP UDP message receipt seems to work well and is buffering nicely with near realtime response.

I now have the inbuilt 'Vera' devices  reporting their state changes and controllable via xAP.  I have implemented the binary on/off and level devices , but not yet looked at text as they are few and far between.  I'm somewhat restricted by my lack of attached Vera devices but it's growing slowly.  I haven't yet looked at scenes.   

Vera will now also recognise and auto create any xAP (BSC) devices that it finds on your network, again so far binary and level are supported and presented accordingly for control using the Vera interface . The status update relies on the confirmation (.event) message seen back from the xAP device inline with how Z-Wave updates work.   

I am currently adding a wildcarding filter for the auto create so that you can select certain devices / categories to add just matching endpoints.    A single xAP Netiom board for example by default could create over a  hundred Vera devices otherwise  (16 x each of these ... digital inputs, outputs, high and low latches, counters,  virtual plus 4 analog and the serial I/O) . 

http://www.phaedrusltd.com/acatalog/info_27.html

 It was fun just including "*.C-Bus.*:>" and seeing all my lighting ,  load control ,  thermostats and heat zoning  for the full house magically appearing in Vera...   ;-)  ... and actually for my remote holiday property too.   Maybe I should think more about the default 'room' categories these are created in which is currently just 'xAP'

I have been leaving Vera running overnight with several of my rapidly changing  xAP endpoints  e.g  electricity & gas meter pulses / counters that can update several times per second ,  weather station info and all the alarm systems PIR's ... it seems to be coping well.   

K

Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on August 22, 2013, 01:42:04 pm
Hi Kevin,

I'm certainly interested in seeing what you've done with the plugin. I'm happy to try it out if it will work with my existing Joggler xAP configuration. Do you need my email to send the files?
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 22, 2013, 04:26:47 pm
The real world devices originating from Vera now have source address names derived from the room and the device name in Vera. This enforces a minimum hierarchy of two levels in teh xAP sub address, although you could have more by including '.'s in the names.   Additionally the UID used is calculated from the device ID in Vera.

e.g.   source=UKUSA.Vera.Controller:Kitchen.Table Light

 I've tried to eliminate as much as possible the device arrays that were hard coded in the previous Lua source and provide some consistency to the naming to make things easier.   Currently you can't override this but I can see that some people will want to and I'll add that as a feature request, along the lines of the original plugin.  If an entry exists in a device array it would replace the automatically derived value.

So at the moment you would have to edit the names of the devices that the Joggler is controlling  (target=)  to match those used by Vera (in the Joggler XML file).  You would also have to edit any UID's that the Joggler is watching / displaying status for. 

So although I would strongly recommend you alter the Joggler XML to match the newer Vera implementation, as it's far tidier,  you might wish to hold fire until a later version is available that would allow you to alter the Vera to match your Joggler.

Yes I'd need an email address, mine is in post #43 -  as I still can't send PM's to members of this forum ... arrrgh

  K
Title: Re: O2 Joggler Plug-In
Post by: RexBeckett on August 22, 2013, 05:18:51 pm
I wouldn't have a problem making new xAPconfig files with different source addresses. The lack of scenes is more of an issue for me, though. It will be interesting to test the latency with your new code. I've PM'd you.

 
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 22, 2013, 06:30:14 pm
I can't even reply to your PM Rex (I have read it) but I haven't looked at scenes at all, even within a Vera only context.  I'll take a quick look and see what's involved as I am a bit bored with wildcard filtering just at the moment...   It maybe something I can do fairly easily and I can appreciate it's an important feature.     If the scene could be triggered by changing the 'Status' of an existing device then likely it will work already but that does require you have some device who's state isn't important to use as an intermediary.   I think I need to do some extra work to expose variables used in my xAP devices as triggers for scenes but then that wouldn't help you as you don't have any xAP devices elsewhere.   

I'm assuming what you really want is to be able to 'run' the scene directly based on the press of a Joggler button.... ??

[edit..]    Just struggling to see how you set up logic / conditionals for scene triggers  like AND's and OR's    ...
              ... You have to add Lua code to accomplish this - wow - that's not very user friendly and a big failing in UI implementation .. but I now see that it's a well trodden gripe !!!   Let's hope there's a UI6 update to address this I feel as it's fundamental.
 
ITMT Rex .. I can now iterate all the scenes and also 'run' them programatically by name , although they unfortunately don't seem to have a persistent ID that is not re-used (unlike devices) which is a PITA for the UID generation .   I suspect the scene number is just an index created at startup i.e. scenes get shuffled as they are created and deleted and so description (name) is the only identifier.   

It would be nice to be able to register a callback 'watch' function that was called  when any scenes were triggered and also when they had completed i.e. after any delays.   This is so my xAP scene devices can also 'event ~ on ' when a scene activates and 'event -off' on completion.  This is so I can create a xAPBSC devices for each scene  that you can then associate with a  Joggler button press  to run the scene.    I'll keep looking to see if this is possible

K
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on August 26, 2013, 07:59:22 pm
Another  brief update after the weekend , sorry I didn't get quite as much time on this as I had hoped.

    I have hit a slight snag in that when auto creating devices the Vera does a reboot in between each one , but it seems if two or three devices try to get auto created quite quickly this mechanism doesn't work well, often creating and partially populating two or three new devices which are unfortunately incomplete.  Not all parameters in the luup.chdev.append  get applied ???    I'll need to look at this a bit more...   Maybe I could accumulate my child additions and then add them en masse using just one synch or make sure two never get added quickly, or maybe as the alt.id does seem to always be correct I can update / populate them correctly next time the xAP device sends it's status.  In initial usage there will probably be these rapid bursts of auto creating as the xAP devices spit out all their .info status reports in a tight loop.

[update] Auto create now works well for lots of devices,  by queuing updates and applying them en masse , so just one reboot.   I also protect against rapid sequential device creations

    I haven't found a way to get notified when scenes are run and so the xAPBSC representation of a scene device does not provide such an .event , instead reporting state=?  but it can be targeted i.e. have a .cmd sent to it to run a scene, which is what I think Rex wanted.  The persistent ID for a scene I don't think will actually be an issue.

   I haven't sent out the first version of code yet as I need to correct a few things after learning a little more about UPnP and Vera .   Once presentable I'll email it to those who contacted me.

    BTW Does anyone know an easy way to get the name of the Vera into Lua ?

K

   
Title: Re: O2 Joggler Plug-In
Post by: akbooer on September 07, 2013, 05:49:23 am
Maybe I could accumulate my child additions and then add them en masse using just one synch or make sure two never get added quickly...

This is what I do in the Netatmo plugin, up to eight devices at a time so far.  Works just fine.  Then I scan the luup.devices variable to pick up the new device IDs and fill in extra variables.

---[Edit: I see you've gone for that solution, I missed your later update]---
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on September 13, 2013, 05:50:10 am
    Thanks for the reply.. and yes after experimenting the bulk add is definitely the best solution.  I have had it add fifty or so devices at one time and it works well.

    I'm working on this plugin on and off at the moment as I have some very busy few weeks just at the moment but it's all looking pretty good.    Been getting to grips with the json device structure so that I can support xAP text devices.    I still haven't worked out how to get at the name of the Vera though.

  K
Title: Re: O2 Joggler Plug-In
Post by: sdhibit on April 08, 2014, 02:02:19 pm
Hi Guys,

Sorry I'm late to the party. I just got a zoneminder installation up and running. It has an xAP component called zmxap that spits out events when motion is detected on any of my cameras that I would like to have the vera react to. I think a general xAP plugin would be a great idea to have for the vera for these types of situations (I don't want to reinvent the wheel by implementing UPnP outgoing zoneminder events if xAP is already there).

If anybody is still monitoring this thread, would it be possible to get a copy of the code you've guys have been passing around? Also, would it be beneficial to put it in some repository for others to view (github, code.mios.com)?

Thanks!
Steve
Title: Re: O2 Joggler Plug-In
Post by: xAPPO on April 25, 2014, 06:55:16 am
Hi Steve,

  Apologies I only just now saw your post here.

  That first release of my rewrite of the xAP plugin was sent to eleven people but only two of those actually replied with any feedback which was disappointing although those two were very positive.

  I think this topic is mainly related to working alongside the O2 Joggler application and other feedback I've received all relates to that application rather than the Vera xAP plugin persay.  The Joggler code (Flash) is not something I want to update as the product is no longer available or supported by O2/OpenPeak.

  My rewrite of the plugin does address some issues with dependable processing of the xAP traffic, which the original plugin might have missed so it's a good step forward for Joggler users and it is far more general as a xAP plugin rather than a Joggler enabler.  It requires Joggler users amend their XML config files which I realise some people don't wish to do.   

   I need to make a couple of enhancements based on the feedback from those two testers, mainly to do with handling xAP devices that use 'text' devices to return signed numerical values - something that 1-wire and temperature sensors often do.  I also need to move more config into the device parameters and UI to make things tidier.  It's also still very much a 'work in progress' although I've been running it happily now for months.

  With regard to ZoneMinder specifically it's unfortunately not a xAP application that I use myself.  The current plugin only handles xAPBSC devices so it won't process messages using any other schema.   Do the xAP  'event' messages that ZM issues use the xAPBSC.event class ?  Perhaps you could post an example message here and I'll let you know if the existing plugin (which I'm happy to send you) will work.     Otherwise you could adapt the code,  if you're up for that,  to just pick up ZM's event class and spoof it back within the plugin as a xAPBSC.event message for a binary device where it would automatically create devices for each camera zone activation - although these would be created as lamp on/off devices rather than say movement sensors.

  Kevin
Title: Re: O2 Joggler Plug-In
Post by: racarter on April 25, 2014, 07:10:05 am
Kevin

As the originator of the xAP plugin I'd be interested to have a look at your mods.

Alan
Title: Re: O2 Joggler Plug-In
Post by: racarter on April 11, 2017, 05:46:06 am
To avoid delays when requesting my xAP plugin please contact me via the webform at carter53.wordpress.com

Alan