I have a long list where i change "user variable" to trigger blocky actions. But want to change 1 specific one to make it easier to read.
See attachment what its now and how can i change this into LUA
Screen Shot 2017-05-08 at 09.47.55.jpg
Screen Shot 2017-05-08 at 09.48.06.jpg
Thanks for helping and push me in right direction of learning LUA code
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave,Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
Having said this, the way to assign a value to a user variable is not by simply assigning.
I use this to assign a value to variable named "TestVariable":
Having said this, the way to assign a value to a user variable is not by simply assigning.
I use this to assign a value to variable named "TestVariable":
Depending on the definition of the variable, you can use "tonumber" or "tostring" functions.
This is the nice thing about Domoticz: simply try it and see what works.
In my server, I have defined a dummy switch called "Testbutton". When I want to test some code, I put it into a LUA script (type "device") like this:
-- Test script
commandArray = {}
--if devicechanged['Testbutton'] then
print ("@@@@@@@@ invoking tester")
-- put the code to be tested here
print ("@@@@@@@@ ending tester")
--end
return commandArray
This way I can change the code, press the test button, and see what happens.....trial-and-error, but it's fun!
Grrr it worked. But does someone can tell me if i can use Scene/Group into a device changed? Tried it but don't work.
Have some scenes and when the scene is on, i also want update a user variable.
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave,Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php