Author Topic: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds  (Read 9762 times)

Offline pls90

  • Full Member
  • ***
  • Posts: 211
  • Karma: +1/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #15 on: June 22, 2014, 05:06:19 am »
Some more testing ...

Quote
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.

Offline cedricm

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +1/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #16 on: June 23, 2014, 06:47:22 am »
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:

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


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...

Offline pls90

  • Full Member
  • ***
  • Posts: 211
  • Karma: +1/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #17 on: June 23, 2014, 07:09:17 am »
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?

Offline pls90

  • Full Member
  • ***
  • Posts: 211
  • Karma: +1/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #18 on: July 11, 2014, 08:12:50 am »
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.

Offline pls90

  • Full Member
  • ***
  • Posts: 211
  • Karma: +1/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #19 on: July 17, 2014, 02:10:12 am »
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.

Offline cedricm

  • Sr. Newbie
  • *
  • Posts: 37
  • Karma: +1/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #20 on: July 18, 2014, 03:44:57 am »
Hi

Thanks for sharing your scene-based setup ;)

For your second slider, make sure that you have specified the proper implementation file when creating the device.
On the 'Advanced' tab of your 2nd device, check "impl_file" (should be I_FGRMLamellasDimmer.xml).

Offline quanghaitrieu6

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #21 on: September 16, 2014, 09:50:03 pm »
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!


<?xml version="1.0"?>
<implementation>
  <functions>
    -- 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
  </functions>
  <actionList>

    <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>

   </actionList>
</implementation>


too many!! Thanks again!

Offline esieczek

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #22 on: October 16, 2016, 04:08:26 pm »
Hi guys,
Has anybody tried that with UI7. I'm quite new to LUA and it would be great to have step by step instruction how to use tilt control with venetian blinds. I would appreciate any help.
Regards
Greg


Wysłane z iPhone za pomocą Tapatalk

Offline Alextaz

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #23 on: January 04, 2017, 02:26:21 am »
Hello,

Same question here... is the frgm-222 working good with ui7 and venetian stores on vera ?

Offline Alextaz

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #24 on: February 10, 2017, 03:41:11 am »
Hello,

Does anybodycould confirm that the CEDRICM code always work on UI7 and vera lite ?!


Offline pls90

  • Full Member
  • ***
  • Posts: 211
  • Karma: +1/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #25 on: February 10, 2017, 05:43:58 am »
I started to move my devices from vera light to plus with ui7. Tilt of blinds can be controlled by @cedricm's dimmer device

Offline Alextaz

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Fibaro Roller Shutter 2 (FGRM-222) with venetian blinds
« Reply #26 on: February 15, 2017, 06:24:54 am »
Ok, i finally confirm the tilt of blinds works with cedricm code on my vera lite with ui7

I've got a problem with on of my three venetian blind...after the blind close it reopen for a few seconds, i make a vid?o here to show you the problem :

https://youtu.be/jIpVaJFLKfA