Set blinds to a specific position between 0% and 100%?

Is it possible to set Somfy blinds to a specific position between 0% and 100%?

I can set them to the top / open with [font=courier]luup.call_action (“urn:upnp-org:serviceId:WindowCovering1”,“Up”,{},67)[/font]

I can set them to the bottom / closed with [font=courier]luup.call_action (“urn:upnp-org:serviceId:WindowCovering1”,“Down”,{},67)[/font]

I can obviously stop them. ;D

I wondered if I might be able to ‘read’ their position with [font=courier]local BStatus = luup.variable_get (“urn:upnp-org:serviceId:Dimming1”,“LoadLevelStatus”,67) or 0[/font] but I didn’t have much luck with that.

I then wondered if I could set their specific position… I don’t think I can, but it would be nice if someone was able to confirm that I cannot.

When I tried with [font=courier]luup.call_action (“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelStatus”,{newLoadlevelStatus = “50”},67)[/font] I didn’t get anywhere. :-[

I can ‘shimmy’ them up from the bottom, with something like this…

[font=courier]luup.call_action (“urn:upnp-org:serviceId:WindowCovering1”,“Up”,{},67)
luup.sleep (500)
luup.call_action (“urn:upnp-org:serviceId:WindowCovering1”,“Stop”,{},67)[/font]

And I guess I could have a bigger delay or a loop around the sleep… but it’s still not perfect in any way. It might look like 50%, but it’s not going to be a confirmed 50%.

Is there even 2-way communication going on here? Can the blinds be interrogated for their position, I’m assuming so…

The plugin has a 0% to 100% slider in the Vera UI (UI7), but that doesn’t seem to work either… so am I correct in assuming it cannot be done?

Any guidance really appreciated.

no two way communication with Somfy RTS motors
Open/stop/close commands with one memorized intermediate position
For native Z-Wave motors with full reporting and positioning between 0-100% contact:
info@zwavemotors.com

Thanks for that, but I am using battery power with my Somfy motors.

Add this to your startup.lua:

[code]function roller_shutter_close(dev_id)
luup.log(“manual positionning - roller shutter close”)
luup.call_action(“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelTarget”,{ newLoadlevelTarget=“0” }, tonumber(dev_id))
return true
end

function roller_shutter_stop(dev_id)
luup.log(“manual positionning - roller shutter stop”)
luup.call_action(“urn:upnp-org:serviceId:WindowCovering1”,“Stop”,“”, tonumber(dev_id))
return true
end

function roller_shutter_position(dev_id, calib_val, target)
– dev_id: device id of the roller shutter
– calib_val: calibration value (measured time to go from fully open to fully closed)
– target: opening percentage target

luup.log(“manual positionning - roller shutter”)

– first step: fully open the roller shutter
luup.call_action(“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelTarget”,{ newLoadlevelTarget=“100” }, dev_id)

–second step: close the roller shutter
if target >= 95 then
return
end
open_delay = calib_val * 1.5
luup.log("manual positionning - roller shutter open_delay is "…open_delay)
luup.call_delay(“roller_shutter_close”,open_delay, dev_id)

–third step: stop the roller shutter at target position
if target <= 5 then
return
end
stop_delay = calib_val - ((calib_val / 100.0) * target)
luup.log("manual positionning - roller shutter stop_delay is "…stop_delay)
stop_delay = stop_delay + open_delay
luup.call_delay(“roller_shutter_stop”,stop_delay, dev_id)

return true
end[/code]

Now, proceed to “manual calibration” of your blinds: open them fully, and check how many seconds are required to go from full up to fully closed.

Then, use the following lua call:

roller_shutter_position(38, 19, 80)

In this example:

[ul][li]blinds device ID is 38[/li]
[li]calibration value is 19s[/li]
[li]target is 80% opening[/li][/ul]

This is a kludge, but it works quite good: blind will go fully up (whatever the previous state), and then will go down to the target level.

[quote=“zwavemotors”]no two way communication with Somfy RTS motors
Open/stop/close commands with one memorized intermediate position
For native Z-Wave motors with full reporting and positioning between 0-100% contact:
info@zwavemotors.com[/quote]
These look great. Sent you an email, hope they’re not prohibitively expensive.

Sent from my XT1040 using Tapatalk

[quote=“Gabriel, post:4, topic:188291”]Add this to your startup.lua:

[code]function roller_shutter_close(dev_id)
luup.log(“manual positionning - roller shutter close”)
luup.call_action(“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelTarget”,{ newLoadlevelTarget=“0” }, tonumber(dev_id))
return true
end

function roller_shutter_stop(dev_id)
luup.log(“manual positionning - roller shutter stop”)
luup.call_action(“urn:upnp-org:serviceId:WindowCovering1”,“Stop”,“”, tonumber(dev_id))
return true
end

function roller_shutter_position(dev_id, calib_val, target)
– dev_id: device id of the roller shutter
– calib_val: calibration value (measured time to go from fully open to fully closed)
– target: opening percentage target

luup.log(“manual positionning - roller shutter”)

– first step: fully open the roller shutter
luup.call_action(“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelTarget”,{ newLoadlevelTarget=“100” }, dev_id)

–second step: close the roller shutter
if target >= 95 then
return
end
open_delay = calib_val * 1.5
luup.log("manual positionning - roller shutter open_delay is "…open_delay)
luup.call_delay(“roller_shutter_close”,open_delay, dev_id)

–third step: stop the roller shutter at target position
if target <= 5 then
return
end
stop_delay = calib_val - ((calib_val / 100.0) * target)
luup.log("manual positionning - roller shutter stop_delay is "…stop_delay)
stop_delay = stop_delay + open_delay
luup.call_delay(“roller_shutter_stop”,stop_delay, dev_id)

return true
end[/code]

Now, proceed to “manual calibration” of your blinds: open them fully, and check how many seconds are required to go from full up to fully closed.

Then, use the following lua call:

roller_shutter_position(38, 19, 80)

In this example:

[ul][li]blinds device ID is 38[/li]
[li]calibration value is 19s[/li]
[li]target is 80% opening[/li][/ul]

This is a kludge, but it works quite good: blind will go fully up (whatever the previous state), and then will go down to the target level.[/quote]

This was very interesting - thank you. What I also found interesting was your use of [font=courier]luup.call_action(“urn:upnp-org:serviceId:Dimming1”,“SetLoadLevelTarget”,{ newLoadlevelTarget=“0” }, tonumber(dev_id))[/font] instead of [font=courier]luup.call_action (“urn:upnp-org:serviceId:WindowCovering1”,“Up or Down”,{},67)[/font]. I will take a good look at this and figure out what’s possible…

What I have found, having 6 blinds, on windows of different sizes (2 x 3-window bays), is that some take longer to travel than others… not unexpected, really.

Yes, that’s why you need a “calibration” value per blind.
My bigger blinds also take more time for down-up travel (21s) than up-down(19s). That’s why as a safety margin I’ve considered that moving to full up position takes as long as 1.5*calibration_value.

Can fractions or tenths of a second be used. There is a lot of travel time during 1 entire second.

Not using this method, as luup.call_delay only uses seconds, not fractions of seconds.

I use something similar as Gabriel with 1 second steps. That means the position is no more than 10% off when not fully open or closed, not something I can see nor the precision I can aim on with manual control. Also 99% of the time I have them running between fully open & closed using automation anyway. I’ll probably borrow some of the nicer then my code from you Gabriel for my next version ;D

Cheers Rene