[quote=“cedricm, post:7, topic:180233”]Next step done: I now have a dimmer controlling the tilt of my Venetian blinds!
It’s a standard dimmable light control, so that the tilt can be controlled from any UI (builtin Vera web interface, AutHomation…).
This dimmer is also able to control multiple blinds simultaneously (set the tilt once, and all connected blinds will move to this new value).
For those interested, here is the required bit of code and instructions.
I renew my disclaimer: use at your own risk!
[tt]
<?xml version="1.0"?>
-- Copy this file as I_FGRMLamellasDimmer.xml in /etc/cmh-ludl on the Vera
--
-- Manually create a new device (Apps / Develop Apps / Create device)
-- device_type: urn:schemas-upnp-org:device:DimmableLight:1
-- device_file: D_DimmableLight1.xml
-- impl_file: I_FGRMLamellasDimmer.xml
--
-- Add the following variable to the newly created device (Advanced tab) to connect it to the FGRM(s)
-- . New service: "urn:fibaro-com:serviceId:FGRMLamellasDimmer1"
-- . New variable: "Devices"
-- . New value: FGRM device ID, or if many, comma separated list of FGRM device IDs
function setLamellasTilt(lul_device, percent)
if percent >= 100 then
percent = 99
end
local devices = luup.variable_get("urn:fibaro-com:serviceId:FGRMLamellasDimmer1", "Devices", lul_device) or ""
for device in string.gmatch(devices, "[^,]+") do
luup.call_action("urn:micasaverde-com:serviceId:ZWaveNetwork1","SendData",{Node=tostring(luup.devices[tonumber(device)].id), Data="145 1 15 38 1 1 0 " .. percent}, 1 )
end
if percent == 0 then
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1", "Status", "0", lul_device)
else
luup.variable_set("urn:upnp-org:serviceId:SwitchPower1", "Status", "1", lul_device)
end
if percent == 99 then
luup.variable_set("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", 100, lul_device)
else
luup.variable_set("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", percent, lul_device)
end
luup.variable_set("urn:micasaverde-com:serviceId:HaDevice1", "LastUpdate", os.time(), lul_device)
end
<action>
<serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
<name>SetTarget</name>
<run>
if lul_settings.newTargetValue == "1" then
setLamellasTilt(lul_device, 100)
else
setLamellasTilt(lul_device, 0)
end
</run>
</action>
<action>
<serviceId>urn:upnp-org:serviceId:Dimming1</serviceId>
<name>SetLoadLevelTarget</name>
<run>
setLamellasTilt(lul_device, tonumber(lul_settings.newLoadlevelTarget))
</run>
</action>
[/tt][/quote]
too many!! Thanks again!