Problem with controlling a roller shutter with smarthings and a fibaro switch (FGRM-222)


(Benjamin J) #1

Dear Smarthings forum members,

I have a question about the usage of Smarthings with a Fibaro device that we want to use to control a roller shutter.

I have the smartthings hub V2 and a Fibaro FGS-222 relay switch.

Starting from completely closed shutter we want the switch to turn on and then turn off after 1800 milliseconds so that the shutter stops in the half open position.

When we first programmed the task with the rule machine plugin two years ago it worked but then after a SmartThings update the routine stopped working.

Now it seems like the second signal after 1800 milliseconds is not received correctly and therefore the roller shutter keeps opening without stopping in the desired position.

Can you help us and let us know how we can realise our desired routine?

Thank you!
Benjamin


(Robin) #2

The Fibaro dual relays have an auto off feature hard coded, it’s adjusted in ms via parameters 4 & 5.

I actually published a device handler for Fibaro FGS-222 just two days ago… It gives quick access to the parameters via the preference page rather than having to change the code itself!!

Unfortunately I messed up the copy / paste when I uploaded it to GitHub so it’s broken right now… Should have GitHub corrected in the next few hours when I get home though.

CoRE can work to ms accuracy but the ST cloud and mesh networks can’t… Best to let the device run its own timer locally.


(Robin) #3

Updated on GitHub now… Should work nicely for you.

Any issues let me know!


(Benjamin J) #4

Thank you Robin!

What do you mean with “Best to let the device run its own timer locally.”?

How can I tell the device to switch OFF 1800 ms after I turned it ON?


(Robin) #5

Fibaros have a built in auto off timer.

  • Install my device handler (above) and assign to your device.

  • Open the device in the ST

  • click on the preferences cog

  • change parameter 4 (for switch 1) or 5 (for switch 2) to 1800.

  • click done

Switch will now turn itself off automatically after 1800ms without needing to be told to do so by the hub.


(Benjamin J) #6

Thank you Robin! Actually I was wrong, I do not need to switch OFF after 1800 ms but instead I need to click ON again to stop the roller shutter. Basically I need to switch ON to start the roller shutter movement and then ON again after 1800 ms to stop it in the position I want.

Any ideas on how I can do this?


(Robin) #7

That doesent make sense, turning something on when it’s already on does nothing.

Are you using a physical momentary button to test?


(Benjamin J) #8

Unfortunately that is how the roller shutter works, in order to stop the movement you need to push the same button again that you used to start the movement.

Actually it is not ON and ON again but it is UP and then UP again… I configured the fibaro switch in a way that ON is UP and OFF is DOWN. That means I need to turn it ON and then ON again after 1800 ms (UP and then UP again)…

Also I just checked again and actually the fibaro switch that I am using here is not the FGS-222 but instead I am using the FGRM222 Roller Shutter Switch…

I hope it makes sense :slight_smile:

Would be awesome if you could help me here to figure this out. Thanks so much!!


(Robin) #9

Hmmmm… So your original brief was completely wrong then lol…

Still makes little sense I’m afraid, if a Fibaro is switched ‘on’, turning it ‘on’ again will do nothing. They need to be ‘off’ before they can turn ‘on’.

The roller shutter module is the only one I haven’t played around with yet, but from looking at the manual it’s fairly simple. It is intended to directly control the motor via up/down/common terminals on the motor.

If I’m understanding you correctly, then I think you have somehow hot wired the Fibaro motor outputs (Q1 and Q2) to the original shutter switches and circuitry instead, so as to re-create button presses?

Or have you connected the original switches to S1, S2 and L on the Fibaro?

If you do me a rough sketch of your existing setup, I should be able to help.

A screenshot of your old rule machine setup would also help… If it still exists?


(Benjamin J) #10

Hi, yeah sorry with all the stuff that I have set up with Fibaro devices I mixed up things… :slight_smile:

I have the fibaro roller shutter device outputs Q1 and Q2 directly going into the bus that controls all the shutters in my house (and the original switches do not go into the S1, S2 and L inputs). So if the fibaro sends a down signal then all my roller shutters get a down signal on the bus and go down and if it sends an up signal they all go up.

So if I use the FGRM 222 code flying around the community (Fibaro FGRM 222 - Roller Shutter) then the UP and DOWN features work great but my problem is that I want to turn all the roller shutters up (starting from completely closed) and then stop the movement automatically after approx. 1800 milliseconds so that the shutters stop in a half open position (so that some light comes in but they are not open)…

If I set up a routine for that in rule machine or CORE it seems like the fibaro device does not get the second signal or maybe misses it since it is too fast? (1800 ms after the first UP I am clicking UP again).

Any recommendations on how to have a reliable setup where every time when I run a routine it does the required use case (start the UP movement of the shutters and then stop it again 1800 ms after)? I would also be willing to buy another fibaro or other z-wave device if you think that would help.


(Robin) #11

Does it stop half way when you tap the button again in the ST app?

If it’s working manually via the ST app then maybe consider using CoRE and turning off ‘command optimisation’ to see if that works.


(Robin) #12

Also, looking at the DH code you are using, it has a stop button.

CoRE will be able to press stop, so worth a try.


(Benjamin J) #13

Yes, it does stop when I press the button again in the ST app but only after a certain amount of time, if I press it and then press again right after it does not recognize the command. Only if I wait maybe 2-3 seconds it works…


(Benjamin J) #14

Where do I turn off ‘command optimisation’ in CORE and what does that do?


(Robin) #15

By defult, CoRE will not send an ‘on’ command if it thinks the switch is already ‘on’. It just skips the action.

Whilst building the piston (main page of the piston) you can scroll down to ‘advanced options’, expand this and you will see the ‘disable command optimisation’ toggle.

The problem you will have though is cloud lag… It varies from day-to-day so shutters will not always stop at the same spot.

Reading the details in the thread you posted above, you should be able to use the dimmer slider to set the percentage open.

Looks like the dimmer slider will only work if you calibrate the device. Connect a momentary switch to S1, Hold for 3 seconds, release, hold for 3 seconds, release, hold for 3 seconds, release. Shutters should then go all the way down and back up to self calibrate.


(Benjamin J) #16

Thanks for all your support!!!

I also believe the only option to have this work reliably is to calibrate the device and then use the slider.

The problem is that I think calibration only works if the device is connected directly to a motor that sends a signal back to the fibaro device once it arrived all the way up/down.

In my case the fibaro device is connected to a bus and on the bus I have all the roller shutters of the house… that means that the device does not get a signal back once the motors arrived all the way up/down and therefore I am not able to calibrate the slider…

Any ideas on how I can manually calibrate the slider and define the min and max values for the slider so that it knows where all the way up/down are?


(Robin) #17

Maybe wire it temporarily to one of the motors?


(Benjamin J) #18

I am not sure how to do this… seems pretty complicated to do the wiring here.

Would it be possible to manually enter min and max values into the fibaro device somewhere? Maybe in the device type?


(Robin) #19

It does have a parameters (22) for adjusting run time… But changing that parameter will mean it will always run for the set time until you change it back to the defult 4 minutes:

Could be done by tweaking the code and inserting some custom commands for CoRE to control, I’ll look into that for you.

Parameter 18 looks interesting as well, allows you to adjust the motor power threshold used by the auto calibration.


(Benjamin J) #20

Thank you so much for looking into this!!