Author Topic: Minimote - Possible to enable Plus / Minus Buttons as Scene Controllers?  (Read 541 times)

Offline ListerD

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
I've created a couple of scenes for dimming/brightening lights which work fine with the 1/2/3/4 buttons.  However, I'd rather have them assigned to the plus/minus buttons instead.  For one, its more obvious.  For another, this would open up two additional buttons for other scenes.  Anyone know if those buttons can be enabled to trigger scenes? 

Offline tomtcom

  • Hero Member
  • *****
  • Posts: 936
  • Karma: +21/-31
Re: Minimote - Possible to enable Plus / Minus Buttons as Scene Controllers?
« Reply #1 on: February 12, 2018, 08:11:58 pm »
I'm positive they couldn't be used for that. They assist in resetting the Minimote and Inc/exc. As I'm sure you know.

You can program each of the 4 buttons for a long press or use lua code as well to achieve some more functionality too.

Sent from my VS995 using Tapatalk


Offline lakewoodjazz

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +1/-0
Re: Minimote - Possible to enable Plus / Minus Buttons as Scene Controllers?
« Reply #2 on: February 13, 2018, 04:00:23 am »
Hey ListerD,
Would you be kind enough to post some example scenes you use making the mini mote buttons dim/bright?
Thanks!

Offline ListerD

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Re: Minimote - Possible to enable Plus / Minus Buttons as Scene Controllers?
« Reply #3 on: February 13, 2018, 01:18:54 pm »
I'm positive they couldn't be used for that. They assist in resetting the Minimote and Inc/exc. As I'm sure you know.

You can program each of the 4 buttons for a long press or use lua code as well to achieve some more functionality too.

Sent from my VS995 using Tapatalk

Actually, I was not aware.  The bottom join button is what I've used for include/exclude.  I was under the impression the +/- were used for direct connected devices when not using a hub.  Hence I was hoping they could be reassigned.

Offline ListerD

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Re: Minimote - Possible to enable Plus / Minus Buttons as Scene Controllers?
« Reply #4 on: February 13, 2018, 01:22:50 pm »
Hey ListerD,
Would you be kind enough to post some example scenes you use making the mini mote buttons dim/bright?
Thanks!

Sure.  This is mostly borrowed with a couple of tweaks.  These dim/brighten in steps of 10%.  Just change the light_main value to your device ID.

Code: [Select]
---turn up
local light_dstat_t = "0"
local light_dstat_n = 0
local light_main = 98

light_dstat_t = luup.variable_get("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", light_main)
light_dstat_n = (tonumber(light_dstat_t) + 10)
if light_dstat_n < 100 then
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = light_dstat_n},  light_main)
else
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "100"},  light_main)
end
---turn down
local light_dstat_t = "0"
local light_dstat_n = 0
local light_main = 98

light_dstat_t = luup.variable_get("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", light_main)
light_dstat_n = (tonumber(light_dstat_t) - 10)
if light_dstat_n >= 0 then
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = light_dstat_n},  light_main)
else
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "0"},  light_main)
end

Offline tomtcom

  • Hero Member
  • *****
  • Posts: 936
  • Karma: +21/-31
Re: Minimote - Possible to enable Plus / Minus Buttons as Scene Controllers?
« Reply #5 on: February 13, 2018, 08:13:01 pm »
I'm positive they couldn't be used for that. They assist in resetting the Minimote and Inc/exc. As I'm sure you know.

You can program each of the 4 buttons for a long press or use lua code as well to achieve some more functionality too.

Sent from my VS995 using Tapatalk

Actually, I was not aware.  The bottom join button is what I've used for include/exclude.  I was under the impression the +/- were used for direct connected devices when not using a hub.  Hence I was hoping they could be reassigned.

You are correct, pressing +- together for a period of time is a master reset of the minmote and +- is used when doing the direct association.

I have used this site quite a bit, check it out > https://aeotec.freshdesk.com/support/solutions/articles/6000035629-in-depth-minimote-guide

Offline lakewoodjazz

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +1/-0
Re: Minimote - Possible to enable Plus / Minus Buttons as Scene Controllers?
« Reply #6 on: February 13, 2018, 11:47:30 pm »
Thanks ListerD
Question
Do I use the dimming as button one short taps and brighten as the long tap?
Or
Button 1  brighten. Button 2 dimming?
I created a scene using my lamp (device #413)
as the device then inserted the complete Lua code you posted with corrected device #

Can I make 2 lamps dim simultaneously or create a scene for each lamp?
Thanks for your help!





Hey ListerD,
Would you be kind enough to post some example scenes you use making the mini mote buttons dim/bright?
Thanks!

Sure.  This is mostly borrowed with a couple of tweaks.  These dim/brighten in steps of 10%.  Just change the light_main value to your device ID.

Code: [Select]
---turn up
local light_dstat_t = "0"
local light_dstat_n = 0
local light_main = 98

light_dstat_t = luup.variable_get("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", light_main)
light_dstat_n = (tonumber(light_dstat_t) + 10)
if light_dstat_n < 100 then
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = light_dstat_n},  light_main)
else
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "100"},  light_main)
end
---turn down
local light_dstat_t = "0"
local light_dstat_n = 0
local light_main = 98

light_dstat_t = luup.variable_get("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", light_main)
light_dstat_n = (tonumber(light_dstat_t) - 10)
if light_dstat_n >= 0 then
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = light_dstat_n},  light_main)
else
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "0"},  light_main)
end

Offline ListerD

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
You can assign the scenes to whatever buttons you want.  My setup is for two bedside lamps.  I use buttons one and two for on/off of the two lamps.  Short press on, long press off.  Buttons 3/4 short press are used for brighten/dim for the lamp on the side of the remote. 

Offline ListerD

  • Sr. Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Oh, lakewoodjazz, I missed the part about the scenes.  You could use the same lua code to dim two lamps simultaneously, or nearly simultaneously as it would run device1, then device2. My application was per lamp.  I did a quick test and the below worked.  There may be a more elegant way to loop through with a device enumerator, but for a quick and dirty, this functions and the result was pretty much instant. 

Code: [Select]
local light1_dstat_t = "0"
local light1_dstat_n = 0
local light1_main = 103

local light2_dstat_t = "0"
local light2_dstat_n = 0
local light2_main = 104

light1_dstat_t = luup.variable_get("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", light1_main)
light1_dstat_n = (tonumber(light1_dstat_t) + 10)
if light1_dstat_n < 100 then
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = light1_dstat_n},  light1_main)
else
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "100"},  light1_main)
end

light2_dstat_t = luup.variable_get("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", light2_main)
light2_dstat_n = (tonumber(light1_dstat_t) + 10)
if light2_dstat_n < 100 then
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = light2_dstat_n},  light2_main)
else
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "100"},  light2_main)
end