The situation I have is that the code works fine when clicking on the dimmer slider to change the level and clicking on "off" to shut the light off; but when I click on "on" the LUA code is not getting the current level of the slider, instead seeing the value of zero.
Code: Select all
1: if (devicechanged['dev'] == 'Off') then
2: print ('Off')
3: else
4: print (otherdevices_svalues['dev'])
5: end
1) I click on the slider at 62%, line 4 returns the the value 20.
2) I click the light bulb to turn the switch off, line 2 returns 'Off'.
3) I click the light bulb to turn the switch on, line 4 returns 0 (even thought the sliders remains at 62%).
Is there a way to get the current value of the slider at line 4 above, so the light will return to the previous value?