We have moved at community.getvera.com

Author Topic: Android app  (Read 9303 times)

Offline structor

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +1/-0
Android app
« on: February 17, 2010, 03:50:46 am »
Hello I have been toying around a little bit with android and vera. I have created a little application called Elisa (loosely based on my two daughters Lisa en Eline). At this moment Elisa is capable of:
  • control device locally and remote
  • displaying devices in a device view and execute their default action
  • displaying events in an event view and execute them
  • displaying a floorplan with the devices on them[/i]
The floorplan is completely in mock. The points are hard coded and also the devices. I am a little stuck in this area, since I now need a place to store these values. With my current vera version(1.0.979) I don't know where to store the points for the floorplans. I have trying to figure out, if I could change the userdata which is send by vera. But I could not find it. From what I understand the new versions have floorplan support, so probably the userdata is expanded with these values. So upgrading probably solves these issues, but what if i want to store some more data. E.g.  the scene list is cluttered with scenes i use for my qees remote but i probably want to hide in my phone. So i would like to have the ability to store these values in vera. Does anybody have some recommendations on how to expand the userdata call or to create a new webcall al together.

(http://lh6.ggpht.com/_BhPSA0R9O2g/S3up1Gfq3bI/AAAAAAAAABo/W3ipbNHPpFI/s512/screenies.jpg)

In the screenshots in the device view, you can also see that the ping sensors are picked up as motion sensors (i will change that). I am also just started with a .net wpf application to design the floorplan (i somewhat missed the flash work and i like smart clients better then webapplications). The wpf application has the same problem as the android app, my vera version is not ready to store/read floorplan data.

(http://lh5.ggpht.com/_BhPSA0R9O2g/S3utQHs5pUI/AAAAAAAAACY/AdC4h8x-RG0/screeny2.jpg)

I plan to put this code in public domain. But i need to find a place where to put it (preferably in git). 

When browsing this forum I also found rakstars homebuddy, which also looks nice.
vera 1.0.979, 2 x Düwi Dimmer, 2 x Düwi switch, 2 x Düwi plugin switch, 1 x Aeon labs door sensor, 1 x EZmotion - 3-in-1 Sensor, 1 x ACT HomePro ZIR010, 1 x Qees ring

guest4690

  • Guest
Re: Android app
« Reply #1 on: February 17, 2010, 09:09:09 am »
Very interesting!

Is it a native Android app?  which calls are you using to interface with Vera?

Offline structor

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +1/-0
Re: Android app
« Reply #2 on: February 17, 2010, 10:00:38 am »
>Is it a native Android app?
No, its created fully with the android SDK, not with the NDK.

>which calls are you using to interface with Vera?
The ones described in the "UI Notes" section building a control only UI. All responses are requested in xml. Perhaps I will switch to json, if it's more performant.

All interaction between UI and veraservice is asynchronous, so the UI remains to feel responsive.
vera 1.0.979, 2 x Düwi Dimmer, 2 x Düwi switch, 2 x Düwi plugin switch, 1 x Aeon labs door sensor, 1 x EZmotion - 3-in-1 Sensor, 1 x ACT HomePro ZIR010, 1 x Qees ring

guest4690

  • Guest
Re: Android app
« Reply #3 on: February 17, 2010, 01:55:26 pm »
The floorplan is completely in mock. The points are hard coded and also the devices. I am a little stuck in this area, since I now need a place to store these values. With my current vera version(1.0.979) I don't know where to store the points for the floorplans. I have trying to figure out, if I could change the userdata which is send by vera. But I could not find it. From what I understand the new versions have floorplan support, so probably the userdata is expanded with these values. So upgrading probably solves these issues, but what if i want to store some more data. E.g.  the scene list is cluttered with scenes i use for my qees remote but i probably want to hide in my phone. So i would like to have the ability to store these values in vera. Does anybody have some recommendations on how to expand the userdata call or to create a new webcall al together.

In the data_request?id=user_data2 result, you can see the <rooms> section, where every room is listed with name, posx/posy and width/height.  Also, on each device definition, if it has been placed in a room, there are room, posx and posy attributes.  If the room attribute is 0, then it hasn't been placed so there's no position, it's only listed in the unassigned devices box.

I'm not sure why you'd like to store data on the Vera.  maybe you want to be able to modify the floorplan from your app instead of just using what is already positioned on the Flash UI?

Offline structor

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +1/-0
Re: Android app
« Reply #4 on: February 17, 2010, 02:44:25 pm »
Note I still have  firmware 1.0.979 (stability is a very important, because it has a big effect on the waf factor  :D)

>In the data_request?id=user_data2 result, you can see the <rooms> section, where every room is listed with name, posx/posy and width/height.
That means that every room must be a rectangle, ouch....

>I'm not sure why you'd like to store data on the Vera.
My floorplan is something I would like to share, between various devices (my phone, my wifes, my computers). So it must be on a server,
otherwhise i need to replicate it on each device...
vera 1.0.979, 2 x Düwi Dimmer, 2 x Düwi switch, 2 x Düwi plugin switch, 1 x Aeon labs door sensor, 1 x EZmotion - 3-in-1 Sensor, 1 x ACT HomePro ZIR010, 1 x Qees ring

Offline denix

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1088
  • Karma: +1/-0
Re: Android app
« Reply #5 on: February 18, 2010, 12:39:30 am »
Nice one! I wish I had time to continue what I started for Vera's touchscreen interface...
Veras (1, 2, 3, Lite, Plus), lots of different Z-Wave modules, Luup plugins and theater/security integration.

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: Android app
« Reply #6 on: February 18, 2010, 02:31:21 pm »
Is it available on the Market?

Offline structor

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +1/-0
Re: Android app
« Reply #7 on: February 18, 2010, 03:25:30 pm »
No it's not in the market. The main reason is that the floorplans are still mockups (the point collections are hard coded). I hope that somebody can help me a bit further to upload these point collections to vera (either by cracking open the userdata or by creating a new http call altogether) (hint hint).  The second reason is that I have no clue how to place it in the appstore.

I also have some other todo's on my list before I would call this app finished:
  • remove mock code and replace with data originating from the vera
  • clean up code and document (this is my first android app and i am a c# guy are my excuses :D)
  • stabilize the code when wifi was enabled and the device goes to sleep and then powered on (seems to be a general Android problem, since all apps on my phone are complaining about the connection.
  • Recognize device more finegrained (e.g. the ping sensors are picked up and displayed as motion sensors) and create som nice icons
  • Create long 'mousedowns' to handle special execution options e.g. for a dimmer a long click should display 0, 25, 50 75, 100% dialog
  • Optimize the response times between execution and ui update (it's reasonable but could be better)
  • Create a notion in the ui when the app is updating its data
  • Extend configuration options, with update rate and possibility to call automatic fetching all together)
  • Extend the ping sensor code with the option to wol some computers and add support to this app
  • Extend the ping sensor code with snmp options and add suppor to this app (i'd like to see when my disks run out of space)
  • Add the ability to hide rooms, devices, scenes

And probably I could think of more.... My biggest problem is that a day only has 24 hours  ;D

Quote
Nice one! I wish I had time to continue what I started for Vera's touchscreen interface...
I plan to place this one in public domain (i am awaiting javiers plans for the app store and code repo), so then perhaps we could join forces.....

I also have plans to port this app to windows mobile, my wife has a winmo phone. I think this should not be too difficult (I know that platform way better and I already have reasonable portions in .net, so porting to compact framework should be doable)
vera 1.0.979, 2 x Düwi Dimmer, 2 x Düwi switch, 2 x Düwi plugin switch, 1 x Aeon labs door sensor, 1 x EZmotion - 3-in-1 Sensor, 1 x ACT HomePro ZIR010, 1 x Qees ring

Offline 325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: Android app
« Reply #8 on: February 18, 2010, 03:45:20 pm »
Great
Does it connect over 3G, LAN, or both?
Can your app show images from the camera devices?

Offline structor

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +1/-0
Re: Android app
« Reply #9 on: February 18, 2010, 03:55:40 pm »
Both 3G and LAN (3G goes through find vera, LAN connects locally).

No camera support, I don't have a camera.

I think I'm also not allowed to buy a camera, my wife is still getting used to the idea I can control the lights and track motion  ;)
vera 1.0.979, 2 x Düwi Dimmer, 2 x Düwi switch, 2 x Düwi plugin switch, 1 x Aeon labs door sensor, 1 x EZmotion - 3-in-1 Sensor, 1 x ACT HomePro ZIR010, 1 x Qees ring

Offline michaelk

  • Hero Member
  • *****
  • Posts: 633
  • Karma: +0/-0
Re: Android app
« Reply #10 on: February 18, 2010, 07:41:38 pm »
might want to hop in on this discussion about  sharing code. there's currently not a plan- but maybe you should chime in with your thoughts to help come up with a plan.

http://forum.micasaverde.com/index.php?topic=3064.msg13910#new

good luck!


Offline BigConsumer

  • Jr. Member
  • **
  • Posts: 59
  • Karma: +0/-0
Re: Android app
« Reply #11 on: February 18, 2010, 11:43:54 pm »
Hmmm... a WPF app for floor plans, eh?  Open Source?  I'm on board!

  I plan on contributing a Voice Command WPF application once i round out some things.  Currently this app polls only once for devices and then builds a grammar for commanding binary and dimmer devices via GET web requests.  That being said its only setup to work locally at the moment - not sure if it makes sense to work remotely.  Works well, sometimes it picks up phrases that rhyme, but it really just brings 'light' to the conversation (har, har har). 

I had no idea how I was going to tackle the floorplan side of things, figured i'd just allow users to upload a BMP and then let them drag/drop some device pointers or something.  maybe we can work on this?

I'd love to get into to Android development, maybe we should talk @structor - sounds like we might be able to help each other out here.

Vera (UI7) - RF9534-N (2), RF9501 (2), HA01 (4), HA06 (3), HA-03WD, WDHA-12, WDRR-372, 3973CR, Phillips Hue (3 A19's)
 http://www.whydidibuythisthing.com

Offline structor

  • Sr. Newbie
  • *
  • Posts: 22
  • Karma: +1/-0
Re: Android app
« Reply #12 on: February 19, 2010, 03:40:18 am »
Quote
Hmmm... a WPF app for floor plans, eh?  Open Source?  I'm on board!
It's not open source yet ;). I would like to publish it, but need to clean up a bit and preferably in a scm related to vera. And if the wpf app is going to be more then a quick floorplan designer, we should perhaps steel some idea's from the ui threads.

O and I (we) need to figure out a license form, GPL? I never bothered to look into license forms, so perhaps somebody else could clue me in. I have some small conditions for sharing:
  • My apps should go under the name Elisa (1 the doughters reason and its coming from family time 2 it matches nicely with vera)
  • If I share, I would like that somebody who uses my code to share back
  • Discussions about the code should be on one forum / website

Quote
I'd love to get into to Android development, maybe we should talk @structor - sounds like we might be able to help each other out here.
We are already talking ;D.

Quote
sounds like we might be able to help each other out here.
Great, no I only need somebody to help out with vera, otherwhise I need to spend some time to figure it out myself. All real actions on my side are going to happen after one week from now. I have to spend some quality time with my snowboard ;).
vera 1.0.979, 2 x Düwi Dimmer, 2 x Düwi switch, 2 x Düwi plugin switch, 1 x Aeon labs door sensor, 1 x EZmotion - 3-in-1 Sensor, 1 x ACT HomePro ZIR010, 1 x Qees ring

Offline denix

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1088
  • Karma: +1/-0
Re: Android app
« Reply #13 on: February 19, 2010, 02:21:19 pm »
O and I (we) need to figure out a license form, GPL? I never bothered to look into license forms, so perhaps somebody else could clue me in. I have some small conditions for sharing:
  • My apps should go under the name Elisa (1 the doughters reason and its coming from family time 2 it matches nicely with vera)
  • If I share, I would like that somebody who uses my code to share back
  • Discussions about the code should be on one forum / website

GPL is specifically enforces the 2 requirement - if anybody uses your code and modifies/enhances it, they have to share it too, or make it public.

As of #1 and #3 - you can add additional small requirement to GPL as long as they don't conflict or invalidate it.
Veras (1, 2, 3, Lite, Plus), lots of different Z-Wave modules, Luup plugins and theater/security integration.

guest4690

  • Guest
Re: Android app
« Reply #14 on: February 19, 2010, 02:24:49 pm »
As of #1 and #3 - you can add additional small requirement to GPL as long as they don't conflict or invalidate it.

I think the Affero GPL deals with #3 (all contribs go 'here').

not that i like the proliferation of licenses.... i personally prefer to deal with just GPL and BSD/MIT