We have moved at community.getvera.com

Author Topic: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!  (Read 94003 times)

Offline pgrover516

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1013
  • Karma: +0/-0
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #45 on: August 20, 2012, 01:49:14 am »
What is the advantage of adding the minimote to VeraLite over just directly adding the Z-wave modules to the minimote ?
Thanks
Understand your frustration and don't know if there's a workaround, but to answer the above question the advantage is that when added to vera it can control (by way of a scene) devices beyond lights, such as open door lock, arm motion sensors, etc. Even with lights I may want a single press to turn one on, another off, and dim a third for example
V1,V2,V3,VLite,Express Controls HSM-100,Intermatic HA20C, HA04C,HA02C,HA09, Leviton VRP15-1LW, VRS15-1LX,Home Manageables HM-TS001,Schlage FE599, Schlage BE369, Cooper RF9500, Aeon Labs Minimote, Schlage TZEMT400AB32MAA+more

Offline cw-kid

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1612
  • Karma: +18/-2
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #46 on: August 20, 2012, 06:44:29 am »
What is the advantage of adding the minimote to VeraLite over just directly adding the Z-wave modules to the minimote ?
Thanks
Understand your frustration and don't know if there's a workaround, but to answer the above question the advantage is that when added to vera it can control (by way of a scene) devices beyond lights, such as open door lock, arm motion sensors, etc. Even with lights I may want a single press to turn one on, another off, and dim a third for example

Thanks, I certainly see the advantage of using the minimote as a scene controller in Vera now and I will be keeping the minimote device added in to Vera and not going back to how I had the minimote setup before.

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #47 on: September 18, 2012, 01:29:49 pm »
Played with the Minimote (MM) a bit over the weekend to look into options related to controlling dimmers.

By default the MM acts as a scene controller, triggering 4x2 scenes in Vera, losing the ability to change the level of a dimmer from the MM, as previously discussed. There are some workarounds.

Experimental / Beta
Given this uses poorly or un-documented low-level Z-Wave commands and features, and has some delays that may be device dependent, we'll need to see how well the stuff below works for folks. It was tested with a Leviton and a GE plug-in dimmer. 

Method A - Make it a regular secondary controller
Put the following in the Luup sandbox (Apps > Develop Apps > Test Luup code (Lua)):

Code: [Select]
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='<nodeID>',Data='x70 4 250 1 0'},1)(Replace <nodeID> with the nodeID of the MM; this is what is shown on the MM's Settings tab as ID (not Device #).)

Then, while holding the top left button on the MM, click the Go button on the Dashboard.
(The SendData command does not get put on the Wake-Up queue; hence the clunky method to keep the MM awake by holding a button and then sending the command.)

This now controls dimmers the same way as when the MM is primary.

Notes:
Having the MM control the lights directly is nice, but because Vera isn't in the loop, the status of the dimmer is not updated in Vera until the next poll. So make sure to enable polling for any devices controlled by the MM that support instant status updates (e.g. Leviton), as by default Vera does not poll these devices. Also, for faster updates, you could write a scene on a periodic timer that polls all devices controlled by the MM, and see how it performs.

This method is easy to enable and may suffice if only controlling some lighting devices. If you also want the scene capability in Vera to do more complex things (with some of the buttons), then consider Method B.


To get back to the scene mode Vera normally configures the MM in (and required for Method B):
Code: [Select]
luup.call_action('urn:micasaverde-com:serviceId:ZWaveNetwork1','SendData',{Node='<nodeID>',Data='x70 4 250 1 1'},1)


Method B - Write scenes to control dimming
Write 2 scenes per button. One for activated and one for de-activated. Besides the appropriate trigger, put the following under the scene's Luup tab:

A scene is activated:
Code: [Select]
local DIMMER_DEVID    = <dimmerDevID>
local DIMMER_NODEID   = <dimmerNodeID>
local DIMMER_ON_VALUE = <dimmerOnValue>
local MINIMOTE_BUTTON = <mmButton>
local MINIMOTE_DEVID  = <mmDevID>
local DIMMING_TIMEOUT = 4
local POLL_HOLDOFF    = 3

local SC1_SID = 'urn:micasaverde-com:serviceId:SceneController1'
local ZN1_SID = 'urn:micasaverde-com:serviceId:ZWaveNetwork1'
local HD1_SID = 'urn:micasaverde-com:serviceId:HaDevice1'
local D1_SID  = 'urn:upnp-org:serviceId:Dimming1'

local lastSceneTime        = luup.variable_get(SC1_SID,'LastSceneTime', MINIMOTE_DEVID) or os.time()
local lastSceneDeactivated = luup.variable_get(SC1_SID,'sl_SceneDeactivated', MINIMOTE_DEVID) or 0
local loadLevelStatus      = luup.variable_get(D1_SID,'LoadLevelStatus', DIMMER_DEVID)

lastSceneTime        = tonumber(lastSceneTime)
lastSceneDeactivated = tonumber(lastSceneDeactivated)
loadLevelStatus      = tonumber(loadLevelStatus)

if ((os.difftime(os.time(),lastSceneTime) < DIMMING_TIMEOUT) and (lastSceneDeactivated == MINIMOTE_BUTTON)) then
  luup.call_action(ZN1_SID,'SendData',{Node=''..DIMMER_NODEID..'',Data='x26 5'},1)
  luup.call_action(HD1_SID,'Poll',{},DIMMER_DEVID)
  return true
else
  if (loadLevelStatus > 0) then
    luup.call_action(ZN1_SID,'SendData',{Node=''..DIMMER_NODEID..'',Data='x20 1 0'},1)
  else
    luup.call_action(ZN1_SID,'SendData',{Node=''..DIMMER_NODEID..'',Data='x20 1 '..DIMMER_ON_VALUE..''},1)
  end
  luup.sleep(1000*POLL_HOLDOFF)
  luup.call_action(HD1_SID,'Poll',{},DIMMER_DEVID)
  return true
end
Replace the following in the first 5 lines:
<dimmerDevID> with the Device# from the dimmer's Settings tab.
<dimmerNodeID> with the ID from the dimmer's Settings tab.
<dimmerOnValue> with the level the dimmer should be set to (1-100, 255=previous).
<mmButton> with the number of the MM's button (1-4).
<mmDevID> with the Device# from the MM's Settings tab.


A scene is de-activated:
Code: [Select]
local DIMMER_DEVID    = <dimmerDevID>
local DIMMER_NODEID   = <dimmerNodeID>
local DIM_THRESHOLD   = 50

local ZN1_SID = 'urn:micasaverde-com:serviceId:ZWaveNetwork1'
local D1_SID  = 'urn:upnp-org:serviceId:Dimming1'

local loadLevelTarget = luup.variable_get(D1_SID,'LoadLevelTarget',DIMMER_DEVID)

loadLevelTarget = tonumber(loadLevelTarget)

if (loadLevelTarget >= DIM_THRESHOLD) then
  luup.call_action(ZN1_SID,'SendData',{Node=''..DIMMER_NODEID..'',Data='x26 4 x78 99'},1)
  luup.variable_set(D1_SID,'LoadLevelTarget','1',DIMMER_DEVID)
else
  luup.call_action(ZN1_SID,'SendData',{Node=''..DIMMER_NODEID..'',Data='x26 4 x38 1'},1)
  luup.variable_set(D1_SID,'LoadLevelTarget','100',DIMMER_DEVID)
end

return true
Replace the following in the first 2 lines:
<dimmerDevID> with the Device# from the dimmer's Settings tab.
<dimmerNodeID> with the ID from the dimmer's Settings tab.


A short press of the button should now toggle the dimmer on or off. When turned on, it will be set at the provisioned level (DIMMER_ON_VALUE); you can use 255 to 'go-to-previous'.

A long press of the button will start ramping up or down. The press only kicks it off, letting go of the button doesn't stop it; to stop the ramping do a short press.

A poll is done after all state changes, so the status in Vera should update.

Notes:
Because the short press double as on/off and stop action, you can not go to the off state immediately after changing the level; there is a time-out, currently set at 4 seconds.

Also, the poll after on/off is done with a delay, currently set at 3 seconds, to give the dimmer time to ramp up/down to the final state; otherwise the wrong value will be polled.

So when testing this, keep the slightly altered button behavior and the time-outs/delays in mind.



Method C - Program buttons to send any command
The MM allows the buttons to emit any sequence of bytes to any group of nodes, making it a very customizable device. This could be leveraged, however there appear to be only 2 events per button, so combining on/off and dimming with just 1 button may not be possibe. Given that, plus the complexity to get it set up, as well as the partial implementation of some of the command classes, making it a one-time-only/first-time-right kind of exercise, I decided to consider this method out-of-scope.
« Last Edit: September 19, 2012, 06:23:56 am by oTi@ »
Dezwaved at the moment...

Offline Roly

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #48 on: September 20, 2012, 06:34:01 am »
Hi guys i am having a problem with my minimote i have latest software on minimote and on my veralite if i set up scenes and run them by the web page all is ok but when i set them up on the minimote button one is short office on button one long office off , then button 2 short stairs on button 2 long stairs off when i push the office on button all works ok if i push the stairs off button it turns office on and not what is programmed under the button any ideas i' stumped

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #49 on: September 20, 2012, 08:48:01 am »
@Roly,

Welcome!

Have you verified that the trigger for the Stairs Off scene is correct? ('A scene is de-activated', 'Which scene' = 2)
Dezwaved at the moment...

Offline Roly

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #50 on: September 20, 2012, 08:55:37 am »
Hi oTi@
I defaulted the veralite and set it all up again and its all working ok now woohoo so now minimote is working ok with scenes
I have only had my veralite for 2 days now so i am still learning i only have 4 devices so far but i have ordered a 4 way switch with leds on when the circuits are off
so looking forward to getting it at the moment 3 of the units are all wired up on my desk while i am playing 4th is setup in office on the light switch and its a mini dimmer
I have X10 in the house as well but after playing with zwave i will be getting rid of it and going all zwave i am very impressed with it looking forward to playing with it

thanks for your response i appreciate it

regards
Roly

Offline Roly

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #51 on: September 20, 2012, 06:38:42 pm »
well its happened again i defaulted the veralite set it all up again setup scenes programmed buttons on minimote for the scenes btn 1 short office light on btn 1 long office light off, btn 2 short office desk on btn 2 long office desk off all worked fine performed a network repair to setup the routes on network and now the buttons on minimote are all up the creek btn 1 short office light on works fine btn 1 long office desk off but it turns btn 2 on (office desk on) instead all the btns with long press no longer work correctly but if i connect using my mobile using Home Buddy scenes all work ok as they should and in web browser i run the scenes and they work as well so it looks like the minimote has screwed up somehow
any ideas guys

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #52 on: September 20, 2012, 10:48:45 pm »
On the Settings tab for the Minimote, does it actually list Minimote as the Model?
Dezwaved at the moment...

Offline Roly

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #53 on: September 20, 2012, 11:26:13 pm »
Hello again oTi@
yes it does say _Minimote
so i am a little confused but i am getting better at programming it can default it up and have it running in no time
so i will have a play again later on tonight and see if i can figure out what i am doing wrong no one else seems to be having problems with it just me so has to be something stupid i am doing but i have to admit if not for the problem with the minimote this stuff is awsum compared to x10 i also have Dynalight in the house and i am thinking of pulling it out and putting all zwave gear in i love it

Offline Roly

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #54 on: September 20, 2012, 11:41:19 pm »
Ok oTi@ i removed the minimote and paired it up as secondary and setup the buttons the same as i had before with the scenes and now all is ok again so now i am relly confused never mind at least it is working
question does anyone know how to change the state of the button on the mini wall lighting module from switch on to momentry without having to pull the switch out from the wall and pushing the button 6 times is it in the sofware somewhere to change or is this the only way to change it



Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #55 on: September 21, 2012, 08:04:34 am »
yes it does say _Minimote
That looks like the default name from the top of the window, not the Model; see screenshot.

[...] removed the minimote and paired it up [...] and now all is ok again so now i am relly confused [...]
Well, so was I when my Minimote was triggering the wrong scenes. This only happened once, and I noticed that the Model field was blank, so I figured the Minimote must not have been included properly / not recognized properly. Excluding and including it, fixed it.

Quote
[...] change the state of the button on the mini wall lighting module from switch on to momentry without having to pull the switch out from the wall and pushing the button 6 times [...]
I'm not aware of another method, but I haven't looked for one either.

Dezwaved at the moment...

Offline LightsOn

  • Hero Member
  • *****
  • Posts: 754
  • Karma: +4/-3
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #56 on: February 10, 2013, 09:03:10 am »
Hi all,

Any idea how to get battery level reports to vera? each time the device wakes up?

Offline oTi@

  • Community Beta
  • Master Member
  • ******
  • Posts: 4041
  • Karma: +32/-6
  • UI what ?!
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #57 on: February 10, 2013, 09:42:46 am »
I think Vera may request reports on her own, fixed, 3-hour schedule. (You could write some code to get it every wake-up; don't know how reliable it would be.)
Dezwaved at the moment...

Offline LightsOn

  • Hero Member
  • *****
  • Posts: 754
  • Karma: +4/-3
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #58 on: February 10, 2013, 11:44:00 am »
Hi @oTi,

Okay many thnaks - email notifications when battery goes below set level should work fine then.  cheers.

Offline chixxi

  • Hero Member
  • *****
  • Posts: 1036
  • Karma: +37/-14
Re: HowTo: Aeon Labs MiniMote fully functional Scene Controller in UI5!
« Reply #59 on: February 11, 2013, 05:04:22 am »
I think Vera may request reports on her own, fixed, 3-hour schedule. (You could write some code to get it every wake-up; don't know how reliable it would be.)

Are you sure? I can set up a trigger "Battery Level goes below..." from the minimote in a scene. But since the minimote does not have any battery-level variable in the advanced tab,  I am now wondering if this will really work.
Developer of Plugins: Virtual Switch, Variable Container, Popcorn Hour Remote, Vacation Ghost. => PLUGINS HAVE BEEN UNPUBLISHED BY ME.