Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds

Hi,
I just installed a FGRM-222 on my Somfy Venetian Blind (between RTS receiver and motor).

Everything works fine, except the lamellas tilt.
I’m able to open/close, move up/down/stop, but I’m not able to manage lamellas orientation.

My settings are :

  • option 10 set to 2
  • option 13 set to 0
  • option 14 set to 1
  • option 29 used once to calibrate and deleted once done.

Will the lamellas tilt be implemented ? When ?

Thanks.
Aymeric.

Can you share how you wired the Fibaro module and the RTS receiver together?
Is the tilt function still working from the Somfy remote?
Do you know what type of Somfy motor is in the headrail?

[quote=“zwavemotors, post:2, topic:180233”]Can you share how you wired the Fibaro module and the RTS receiver together?
Is the tilt function still working from the Somfy remote?
Do you know what type of Somfy motor is in the headrail?[/quote]

Yes, I plan to share it on a blog with he wiring diagram… I’ll post it here too.

All the previous fonctions of my Somfy remote are still working through the fibaro.
Note that I only have the basic Telis remote : Up/Down/‘My’ only, without tilt function.

My motor is a J4, and the receiver is a standard Somfy RTS.

Hi there,

Also just installed a FGRM on my Venetian blinds (also powered by a Somfy J4).

Works great except, obviously, the missing tilt control from the UI (works fine from the physical push button though).

Would be great to have a dump of ZWave data sent by a Home Center when changing tilt (it’s possible to send arbitrary ZWave data using luup, so implementing a separate dimmer to control the lamellas might be doable).

I tried to analyze the ZWave data sent by the FGRM to the Vera when manually changing tile. The only stuff that is reported is the blind opening % and power usage. So I guess that the FGRM also needs to be told to send “tilt-aware-controller” data.

Actually, parameter 3 needs to be set to 1 to get the lamellas tilt report when manually operating the blind.
When paramter 3 is set to 1, the ZWave frame sent by the FGRM to report a change is the following:

[tt]0x91 0x1 0xf 0x26 0x3 0x3 <blind %> <lamella tilt % (0x63 = 99 = vertical, 0 = horizontal)>
[/tt]

0x91: is the Manufacturer Proprietary command class
0x1 0xf 0x26 0x3 0x3: needs to be decoded (I guess that 0x26 has something to do with the venitian blind feature)

Next step is to try to decode this and see what command can be sent back to the FGRM to change opening/tilt (using luup.call_action(“urn:micasaverde-com:serviceId:ZWaveNetwork1”,“SendData”,{Node=", Data=“0x91 <…>”}, 1) ?)

Mostly good!

My current understanding of the fibaro command class protocol for the FGRM is the following:

[tt]0x91 0x1 0xf 0x26 <blind %> <tilt %>[/tt]

: 1 = SET, 2 = ? (GET, I guess), 3 = REPORT
: 1 = SET, 2 = ? (GET, I guess), 3 = REPORT
<blind %>: 0 to 99%, 0 = fully closed, 99% = fully opened
<lamellas %>: 0 to 99%, 0 = vertical, 99% = horizontal

It seems that blind % and tilt % can’t be changed simultaneously.
When using command #1 for , & <blind %> seems to be ignored
So to change <blind %>, it seems that using command #2 for works.

Still need to do more test, and as I don’t have any Fibaro documentation of their proprietary protocol this is just plain guessing.

So disclaimer here: you are on your own, if you break something due to this, I’m not responsible – use at your own risk!

So, to change blind position from a LUUP scene (an easier way is to use the standard ZWave dimmer command, this is just to verify my understanding of the protocol):

[tt]blind_position=0 – closed, acceptable values: 0 to 99 (in %)
luup.call_action(“urn:micasaverde-com:serviceId:ZWaveNetwork1”,“SendData”,{Node=“”, Data=“145 1 15 38 1 2 " … blind_position … " 0”}, 1 )
[/tt]

To change lamellas orientation :

[tt]tilt=50 – change tilt to 50%, acceptable values: 0 (vertical) to 99 (horizontal) (in %)
luup.call_action(“urn:micasaverde-com:serviceId:ZWaveNetwork1”,“SendData”,{Node=“”, Data=“145 1 15 38 1 1 0” … tilt}, 1 )
[/tt]

:slight_smile:

Next step: implement a nice standard dimmer control to wrap this in a nice and standard UI!
Next next step: implement automatic lamella tilt by tracking the sun during the day!

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]

@cedricm this is excactly what I was looking for. To be able to control the tilt of all my blinds with one dimmer device is absolutely incredible. Well done. Thank you so much.

You’re welcome :wink:
Let me know how it works for you!

I followed your description and have now a slider device for my blinds. Started testing on one blind.
When I move the slider from 0% to 50% the UI updates the device to 50%, blind changes tilt as expected. Great!
The next move of the slider to e.g. 80% will not be updated in the UI, device still shows 50%.
Tilt of blind does change to 80%.
So the only thing not working is the reported tilt percentage in the UI.

I thought how to go forward from here and would be interested about you opinion.

I use some PLEG conditions / actions together with the heliotrope plugin to control my blinds. South and West side are controlled interdependently, so I plan to use 2 devices to change tilt of S and W side according to the altitude variable of the heliotrope plugin.
Do I need to check if every individual blind is actually down before changing tilt angle?
Even if the PLEG has closed all blinds someone could have manually openened one or more blinds to go through one of three doors into the garden.
I don’t want to change tilt of a blind that has not been closed, even if the end switches would prevent damage to the blind motor. If that happens on a regular basis it will certainly not extend the mtbf of the end switches.
But - with over 15 blinds this will make the PLEG conditions rather complex.
Am I overcomplicating things?

I have to say I’m very pleased with what you have accomplished. ;D

What UI are you using?
I don’t see why it wouldn’t always get the new tilt value.
Seems to be fine for me with both the standard MCV web UI & AutHomation.
Maybe this is just your UI/Vera being slow to propagate the new value to your UI.

However, bear in mind that the dimmer is not notified of manual changes (this would require a firmware upgrade from MCV to properly parse the reports sent back by the FGRM).

Otherwise, I didn’t know about the heliotrope plugin… you probably saved me a few (?) hours worth of work implementing the same thing… thanks :smiley:

I haven’t implemented what you are trying to achieve yet… but I guess that, for each blind, I will check that it’s at least 33% closed before changing it’s tilt (just to be on the safe side too).
So I guess that my dimmer implementation can/will be updated a bit to ignore the tilt order when opened :wink:

E.g., this is probably just a matter of changing

[tt]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 )
[/tt]
with

[tt]if tonumber(luup.variable_get(“urn:upnp-org:serviceId:Dimming1”, “LoadLevelStatus”, tonumber(device))) > 33 then
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
[/tt]

I’m on 1.5.622.
I waited for more than an hour, no UI update. I don’t think my vera is that slow. :wink:
So I’m not paranoid about checking whether each blind is opened before changing tilt after all. I’ll try your suggested change as soon as possible. Hell, this IS a lot easier than putting it in PLEG conditions. :sunglasses:
Thanks again!

Ok, did some more reading and got the UI to show the right dim level. I had to set parameter 3 to 1 as you already stated was necessary.
Another thought:
Is it possible to store the desired tilt level into the target device?
If I can’t do that I would have to wait for all of the blinds to reach their desired position and then send the command to set the tilt level. Any thoughts on this?

Hi,

If you set parameter 3 to 1, the Vera won’t be able to decode the report sent by the FGRM when manually operated :wink: (e.g., if someone changes the position of the blind manually, the Vera won’t know).
And I fail to see how this would help having the correct tilt value in the dimmer.

[quote=“pls90, post:13, topic:180233”]Another thought:
Is it possible to store the desired tilt level into the target device?
If I can’t do that I would have to wait for all of the blinds to reach their desired position and then send the command to set the tilt level. Any thoughts on this?[/quote]

I don’t see any parameter in the FGRM that would allow setting the target tilt value. This is possible with the FGD-221, but not for the FGRM as far as I know.
So I guess you indeed have to wait for the blind to reach their final position before changing the tilt… unless… did you try to change the tilt while the blind is moving up/down? maybe the FGRM already deals with that after all. I haven’t test this yet.
If one really needs to wait for the blind to stop before changing the tilt value, this can be done by monitoring the blind power usage (and waiting for the power usage to be <= 1W) :wink:

I did some testing a few days ago. Even when in motion FGRM stores the value for the desired tilt angle. So we don’t have to wait until the blinds are in their final position. If the blinds are completely open (upper end position) sending a tilt change command will cause them to move shortly. So checking if they’re open more than x% should still be done. I will try to change parameter 3 again and see if tilt value is reported in the UI.

Some more testing …

if tonumber(luup.variable_get("urn:upnp-org:serviceId:Dimming1", "LoadLevelStatus", tonumber(device))) > 33 then 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

The if statement does’t seem to work for me. I tested on 2 blinds, none of them will change their tilt any more, regardless of their loadlevestatus (no change in tilt even if completely closed).
I just realized that some of my blinds show a wrong position in the UI (e.g. 0% even if their completely closed). So this will also be problem when using the loadlevelstatus to decide for which blinds to change the tilt.

Hi,

Good to know that the tilt can be changed while the blind is in motion 8)

The “if” statement provided was not tested and indeed incorrect, sorry for that. I got the level % inverted. Correct code, for blinds <= 80% open would be:

[tt] if tonumber(luup.variable_get(“urn:upnp-org:serviceId:Dimming1”, “LoadLevelStatus”, tonumber(device))) < 80 then
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
[/tt]

However, I also have just figured out that the level reported by the FGRM gets incorrect after some time (in my case, it reports 100% open even when fully closed)… until this bug is identified/fixed, this “if” statement is indeed useless…

Thank you for the new if statement.
I read on an other thread that someone has raised a ticket on the issue of incorrect % readings.
I would’t hold my breath though that we will see a fix soon.

I’m trying come up with a PLEG condition that fires when one of my door blinds was manually opened to go through the door.
There are triggers for “device is turned on/off”, that won’t tell me about a manual up command.
The properties of the FGRM didn’t look promising eather. “Status” property is 0 in upper and lower position.
Do you know if “status” can be used to identify an “UP” movement?
Anything else?

I just found out that the FGRM-222 devices have a scene controller capability like the Fibaro dimmers.
I am using this to set a virtual “manual mode” for the blinds at doors so that I won’t be locked out when the blinds go down.

On a FGRM-222 Set parameter 50 to 1
do the vera dance
double click the up or down buttons of the FGRM
open the device, and on the advanced tab will be 3 new variables:
LastSceneID, LastSceneTime, sl_SceneActivated

in PLEG create 3 device properties
p_blind_kitchen_door_SceneActivated
p_blind_kitchen_door_LastSceneTime
p_blind_kitchen_door_LastSceneID

create a condition in PLEG (not my finding, this was discovered by someone else), e.g. c_kitchen_door_manual_mode_on
(p_blind_kitchen_door_SceneActivated;p_blind_kitchen_door_LastSceneTime) AND (p_blind_kitchen_door_LastSceneID == XX)

whereas XX can be set to
14 UP double click
15 UP triple click
24 DOWN double click
25 DOWN triple click

You can use the condition c_kitchen_door_manual_mode_on to avoid blind movement when manual mode is on.
I found UP double click for manual mode on and DOWN double click for manual mode off easy to remember.

I almost have everything working the way I want it to. Almost.
I followed @cedricm instructions and created 2 new devices to have different tilt angles for different windows.
The original one works like a charm, the 2 new ones don’t react to changes of the slider at all.
I double checked the device IDs for the blinds.
I have no idea what is going wrong.