Fibaro Dimmer 2 (FGD-212) Pairs but Doesn't Work


(Adam Callaghan) #1

Hi all,

I hope this works. I’m new to ST (as in today!) and this is the first time I’ve ever joined a forum so please go easy on me. I don’t know if I’m posting in the right place so please move me if you feel the need.

I have successfully hooked up my hub and wired a Fibaro 2 Dimmer behind a standard UK light switch. The app pairs with the device but it doesn’t actually do anything. I believe the app is behaving as it should i.e. turn on/off works within the app but nothing happens to the light itself :confused: It’s wired up correctly as far as I can tell and the hub shows as connected within the phone app. I’ve had a good Google and the only page I could find was this:

Unfortunately the solution offered is way beyond my understanding although it appeared to work for the user with the same problem.

I have read a few articles on this site prior to investing in ST and it seems like a great community, full of knowledgeable people so I’m sure someone out there can help this noob out :slight_smile:

My level of understanding is very basic at the moment so please explain things nice and simple.

Thanks!


(Adam Callaghan) #2

Hello again,

I had another Google last night and read through a very long article that suggested implementing some custom code. I randomly clicked around and have managed to get the light working! This is the code I used:

No idea how I managed it but hey-ho.

I can now operate the light (on/off) from the ST app but dimming does not work. I’m assuming this is something to do with what is written in the code and using a different code would rectify this. My other issue is that the dimmer does not appear when I search for devices in the Alexa app. It did previously.

I’m kinda lost now! Does anyone know of the ‘best’ code for me to use which a standard UK light switch (up for off and down for on) that will allow me to use the dimmer with Alexa?

Thanks all!


(Robin) #3

Welcome to Smartthings and the forum!!

This device handler by @hajar @zcapr17 is by far the best (I would say flawless) for the dimmer 2 switches.

https://github.com/hajar97/FibaroDimmers/blob/master/devicetypes/fibarodimmer2.groovy

If you are using a standard uk toggle switch you need to change parameter 20 to ‘1’ as the device defaults to momentary switch.

Changing the parameters is easy with the above code. When viewing the device in the ST app you can click the ‘cog’ symbol to bring up all the options.

Note that you won’t get any manual dimmer controll at the switch when using a toggle switch (dimming will only work from the app).

The dimmer 2 works best with momentary (retractive / push to make) switches.


(Robin) #4

I posted a lot of info about momentary switches in the following thread:

If you want to activate the sending of scene ID’s you need to change parameter 28 to ‘1’.


(Adam Callaghan) #5

Hi @RobinWinbourne

I found another thread and managed to get the dimming function working within the ST app but Alexa still won’t find the dimmer.

I tried using the code you copied, and changed the parameter to suit my switch but got this error. No idea what it means!

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
script1485099077999481762955.groovy: 27: expecting ‘}’, found ‘,’ @ line 27, column 29.
26 attribute “scene”, “number”
^

1 error


(Robin) #6

No idea… Works for everyone else???

Maybe you got the copy / paste of the code wrong?


(Adam Callaghan) #7

No idea! I reverted back to the original code I mentioned above, changed the parameter for dimming, removed the ST skill from Alexa then re-added and all is well in the world! Really appreciate your offer of assistance. Steep learning curve but I’m sure with the helpful people on here I’ll get the hang of things. Thanks again :slight_smile:


(Robin) #8

It really should have worked flawlessly…

Out of interest, were you trying to change the parameters within the code itself or via the preferences page within the ST app?

The error message you posted suggests to me that the code had been tweaked.

If you changed the section of code ‘Def ConfigureAfterSecure’ and accidently missed a } then it would throw up the error you posted.

The original code shouldn’t be changed at all… Just copy and paste the whole lot, save and then publish>for me.

Parameters are changed within the ST app on a page that looks like this:


(Robin) #9

The device handler you posted requires you to change parameters via code tweaks which is where I think the confusion lies.

@hajar’s code makes it a much simpler process via the ST app without ever having to tweak the code.


(Adam Callaghan) #10

I’m pretty sure I copied it perfectly and I’m reluctant to try it again in case I mess it up now everything’s working as it should. I changed the parameters within the code itself and only changed the number, not ‘Def ConfigureAfterSecure’

I then published as you have said

I’m sure what you’ve said is correct as you know far more than I do!

I wasn’t aware you could update the parameters within the app and I can’t seem to find a page that looks like the pic you’ve posted. Just so I know, where is that functionality? What’s the difference between the code I’ve used and the one you’ve suggested? My current setup appears to do the basics, which is all I need, but if your suggestion offers something more then I may consider updating the code when I get a bit more brave.

Thanks again!


(Robin) #11

Yep, that’s your problem 100%. Leave the code exactly as it came and don’t change a single part.

The code by @hajar gives you the ability to update and test parameters on the fly from within the ST app without ever having to go back into the IDE.

The code method of updating the parameters is completely different to the other DH you posted so changing the reference to ‘param20’ in the ‘Def ConfigureAfterSecure’ section of @hajar’s code to say ‘1’ would not work unless you got the square brackets [ ], wobbly brackets { } and commas , exactly right.

The code also gives you the ability to use the 1x, 2x, 3x hold and release events of both s1 and s2 (when using momentary switches) or a smaller number of events when using toggle switches. Change parameter 28 to ‘1’ (in the app, not the code) and you will start seeing the scene ID’s translating into the ‘recently’ tab of the device.

The CoRE smartapp can then see these scene events and trigger all sorts of other things to occur… Opens up a huge new world of possibilities:

When viewing the device in the ST app you will see a symbol in the top right corner of the page that looks like a cog, this will take you to the preferences page. On most devices you only get the option to change the device name and image but on @hajar’s code you also see all the parameter options.

Trust me, try again, you won’t be disappointed!!


(Adam Callaghan) #12

Appreciate your thorough response! I’ll leave it as it is for now but I might be tempted to have a play in future :wink: Thanks again for your help.


(D Bagus Handhoko) #13

Hi Adam and Robin,

i have dozen of FGD 212 too, just a few days intall ST and Alexa… so with @hajar code , all functions working well from alexa side , incl dimming function ?


(Robin) #14

Yep… @hajar’s code works perfectly.


(D Bagus Handhoko) #15

thank you robin


(D Bagus Handhoko) #16

now i failed up create the code, even i just copy as it is… any idea ?


(Robin) #17

Sorry I don’t understand the question?

You don’t need to change any code, just copy and paste.

  • Copy the code from the GitHub link posted above
  • Log into the IDE, go to locations and click on your home location (it will ask you to log in again) - just to check your on the correct IDE shard.
  • Go to device handlers tab
  • Click new Device Handler
  • Click from code
  • Paste code
  • Click OK (or it might be ‘done’) at the bottom
  • Click save at the top
  • Click publish > for me
  • Go to the devices tab
  • Click on your Fibaro Dimmer
  • Click edit
  • Change type to match the new DH you saved above
    *Save and you’re done

Changing of parameters is done via the device preferences page within the ST mobile app.


(D Bagus Handhoko) #18

thank you … finally success create device handler


(D Bagus Handhoko) #19

Robin, actually really sorry because i am very new for ST. I try to pair FGD 212, but failed … my steps :

  1. General Device exclusion, Fibaro click 3 times ( nothing happen )
  2. add things, fibaro click 3 times ( nothing happen too ) .

so any mistake i made ?


(Robin) #20

You shouldn’t need to exculde?

When adding the divice you need to do the 3 clicks fairly fast… I find its easier to use a momentary switch connect to S1/Sx.

Can take a minute or two to pop up on the screen sometimes but normally within 10-20 seconds.