We have moved at community.getvera.com

Author Topic: Aeotec Nano Dimmer Switch Issue  (Read 483 times)

Offline LiteEarthTreader

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Aeotec Nano Dimmer Switch Issue
« on: February 01, 2019, 09:16:19 pm »
Hi,

I've recently purchased a VeraEdge and Aeotec NanoDimmer, and have set up an enclosed test jig with the Nano Dimmer wired in 2 wire mode (eg with Neutral and Active wired together on Nano Dimmer) to a desk lamp.  A standard toggle light switch is wired between the Sw1 and Com contacts.  I originally had a dimmable LED globe in the lamp (with NanoDimmer Bypass), but have replaced with standard Incandescent globe for now.

There is an older member of our family who looses track of time and stays up reading all night - and then sleeping most of the day.  The idea behind this project is to install Nano Dimmers in several lighting circuits in the house concerned, and through the Vera, dim the lights at pre-set times to a level below which she can read, but bright enough for finding her way around the room(s).  She doesn't use Smartphones or PCs, so after initial set-up, the primary controls for the lights need to be good old-fashioned light switches.

The project is partially working; I've set up three Scenes, with Full Brightness, Mid Brightness and Low Brightness light levels specified.  I've used the following Lua (with different initial brightness levels set for the different scenes):

Code: [Select]
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "70"}, 4)
local lul_tmp = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", 4)
if (lul_tmp == "0") then
    luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "0"}, 4)
end

When the lamp is already on, the scenes change as expected.
When the lamp is "off", the lamp comes on momentarily then off again.  This is annoying, but from what I've read there's no other way around it.
If I now try and turn on the lamp via the Vera Web interface, the lamp will come on to the newly set level.
However, if I try and turn on the lamp via the switch wired to the NanoDimmer, the lamp switches on, but with the previously selected brightness rather than the new one.
If after changing the scene I use the Web interface to turn the lamp on and off firstly, the lamp will then turn onto the new level via the switch.

Basically, while the switch is supposed to turn on to the last known level, it doesn't appear to do this if the previous action by Vera was to change the level via scene Lua.

Any ideas on settings I should change - or other Lua I should be using?

- Rob.
« Last Edit: February 02, 2019, 07:15:29 pm by LiteEarthTreader »

Offline LiteEarthTreader

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Aeotec Nano Dimmer Switch Issue
« Reply #1 on: March 06, 2019, 01:35:26 am »
Testing and final resolution:

I tried inserting a couple of different types of 'delay' code, one of which is shown below:

Code: [Select]
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "10"}, 7)
luup.sleep(900)
local lul_tmp = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", 7)
if (lul_tmp == "0") then
    luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "0"}, 7)
end

This didn't work, so I decided to try my luck with the Fibaro Dimmer 2 module.  Unfortunately, this had similar issues.
I then went back to the Lua, and tried the below, which worked with both the NanoDimmer and Fibaro:
 
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "10"}, 7)
local lul_tmp = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", 7)
if (lul_tmp == "0") then
    luup.sleep(1200)
    luup.call_action("urn:upnp-org:serviceId:Dimming1", "SetLoadLevelTarget", {newLoadlevelTarget = "0"}, 7)
end

From a logical point of view, I can't see why putting the delay after the If statement would fix things.  Can anyone explain why?
A post in another forum seemed to suggest that the Vera didn't like delays longer than 900 ms.  I found the minimum delay that would work was just under 900 ms, but that delays of around 1200 seemed to be more reliable.

After testing both dimmer modules, I found the functionality of the Fibaro was more to my liking in this situation.  The Fibaro has an option to 'sync' the toggle switched position.  (ie If the toggle switch is 'off' and the lights are turned 'on' via the web interface/app, moving the toggle switch to 'on' doesn't change the light state.  But it will change when the toggle switch is turned 'off' again.  With the Nano dimmer, the toggle switch always changes the light state - so you can get to the situation where toggling the switch 'on' turns the light 'off'.  I also experimented with a push button switch, but I couldn't seem to disable the ability to ramp the lights up or down when holding the switch in.