Author Topic: How to set a device variables in a scene?  (Read 78 times)

Offline Mr J

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
How to set a device variables in a scene?
« on: August 06, 2017, 03:09:58 pm »

I have a Fibaro Dimmer 2. Default behavior is to set the brightness level to the previous level when turned on (single clicked). However, I would like to change this, so that during night time is set to a lower level, say 10%, when turned on. During day time it should go back to default behavior. I have created to scenes for this purpose, but cannot get it to work.

First I tried to use the actions SetOnEffect and SetOnEffectLevel, which are easily set in the Advanced Scene Editor, that controls this according to the standard, but the Dimmer 2 seems to be unresponsive to these actions. I later found that they are optional in the standard.

My second idea is to change device variable 19, which controls this for the Dimmer 2 module. During night time its value should be 10, and during daytime it should be 0. It can be set in the GUI in Device Options, but how to set it in a scene?
I'd guess some lua/luup coding is requred here, right? I have never done this before, could someone please help me? Or point me in the right direction.