We have moved at community.getvera.com

Author Topic: O2 Joggler Plug-In  (Read 27769 times)

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Re: O2 Joggler Plug-In
« Reply #15 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.
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: O2 Joggler Plug-In
« Reply #16 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 :)
« Last Edit: April 06, 2013, 03:51:46 am by parkerc »

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-13
Re: O2 Joggler Plug-In
« Reply #17 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.

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: O2 Joggler Plug-In
« Reply #18 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.. ;)

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-13
Re: O2 Joggler Plug-In
« Reply #19 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.
 

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-13
Re: O2 Joggler Plug-In
« Reply #20 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?

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Re: O2 Joggler Plug-In
« Reply #21 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
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: O2 Joggler Plug-In
« Reply #22 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?
« Last Edit: April 07, 2013, 03:22:55 am by parkerc »

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Re: O2 Joggler Plug-In
« Reply #23 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.
 
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-13
Re: O2 Joggler Plug-In
« Reply #24 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?
 

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: O2 Joggler Plug-In
« Reply #25 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)
« Last Edit: April 09, 2013, 02:55:59 am by parkerc »

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Re: O2 Joggler Plug-In
« Reply #26 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.
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: O2 Joggler Plug-In
« Reply #27 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.. :-)
« Last Edit: April 11, 2013, 03:51:18 pm by parkerc »

Offline racarter

  • Hero Member
  • *****
  • Posts: 519
  • Karma: +12/-4
Re: O2 Joggler Plug-In
« Reply #28 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.
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline RexBeckett

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3891
  • Karma: +483/-13
Re: O2 Joggler Plug-In
« Reply #29 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...