Hello,
I'm new to the Domoticz and scripting in LUA. I would like som help to make a script for a dimmable light. I have searched the forum but could not find an awnser.
If the light is on, and there is no movment for 15 minutes i want to store the actual light level and dim the light.
If there is movment detected the light should return to the stored level. (before dimming)
if deviceValue["MotionDetector"]=='off'
then uservariables["Previous_Dim"] = otherdevices_svalues['Dimmer']
otherdevices_svalues['Dimmer'] = '15'
end
Script LUA: storing dimmer value
Moderator: leecollings
-
- Posts: 3
- Joined: Friday 13 January 2017 15:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 15b013c
- Location: The Netherlands
- Contact:
Re: Script LUA: storing dimmer value
You can make this in blocky.
IF Motiondetector == off
dimmer_value_old = dimmer_value
dimmer_value = 15
If motiondetector == on
dimmer_value = dimmer_value_old
(Look at attachment, make a user variable to store old value)
IF Motiondetector == off
dimmer_value_old = dimmer_value
dimmer_value = 15
If motiondetector == on
dimmer_value = dimmer_value_old
(Look at attachment, make a user variable to store old value)
- Attachments
-
- example.PNG (25.09 KiB) Viewed 2263 times
Who is online
Users browsing this forum: No registered users and 1 guest