dzVents set dimmer level

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Pappabear
Posts: 2
Joined: Thursday 24 August 2017 14:07
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

dzVents set dimmer level

Post by Pappabear »

Hello,

I'm very new to domoticz and dzvents.
I have a Fibaro motion sensor and a Fibaro dimmer.
I'm already able to switch the light on and off after motion during nighttime but I would love to set the level of the dimmer with dzVents
(as you would do with a "level xx %" block in blocky), any ideas? I tried several things but nothing is working

Code: Select all

local LichtHal = domoticz.devices('Licht hal')
		
		if (timeofday['Nighttime']) then
			if (switch.state == 'On') then
--->				LichtHal set level dimmer
				LichtHal.switchOn()
			else
				LichtHal.switchOff()
			end
		else
			LichtHal.switchOff()
		end
Tnx,
Luc
elmortero
Posts: 247
Joined: Sunday 29 November 2015 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9639
Location: Spain
Contact:

Re: dzVents set dimmer level

Post by elmortero »

you are looking for this:
then
LichtHal.switchSelector(TheLevelYouWantTOSetItTo) --> the level is Numeric
end

It is explained in the dzVents Wiki
Pappabear
Posts: 2
Joined: Thursday 24 August 2017 14:07
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: dzVents set dimmer level

Post by Pappabear »

tnx for the reply

I already managed to do it now with LichtHal.dimTo(percentage)
This probably didn't work before because I used the wrong device name :-(
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest