Fibaro 2 Dimmer (212 not 211)

I should add i was using the basic code no problem before this and the dimmer was working, ive changed the device handler for my working device from the smart things one to the one you posted above, so the device itself shouldn’t be the problem

Just wanted to say thanks to Rajiv for posting the code.

Installed my first Fibaro 2 dimmer today. Works perfectly with a toggle switch.

A few issues I ran into, incase anyone suffers from the same:

I couldn’t get the Device Handler to display on my phone. It appears I wasn’t logged into my spur of the IDE.
I have a 3 wire system and couldn’t get it working. Switched to a 2 wire system and it works fine - it’s possible the Neutral wire isn’t connected to anything (I live in a UK newbuild).
On turning on the lights, they would stay on for a few seconds then turn off. I had 6 50W halogen GU10 lights connected to the dimmer, so I needed to increase the max load from the default of 250W to 300W.

Tomorrow the remaining two dimmers I bought will go in!

Agreed, thank you Rajiv and Elnar Hajiyev!

I am hopefully trying three wire this evening (I will need to try by the bulb rather than the switch) since with two wire my LEDs glow from the trickle power. Given its a bedroom, having the faintest glow from our bedroom lights is actually quite creepy! If that fails then I will have to buy the Dimmer 2 Bypass device - though I am loathed to spend £10 on a capacitor and resistor pair which only cost 10p! (maybe I should disassemble and create a compatible unit…)

ive just read the docs for the default value feature and it looks like its a broken implementation

the docs say

Additional Notes
Setting a default value (defaultValue: “foobar”) for an input may render that selection in the mobile app, but the user still needs to enter data in that field. It’s recommended to not use defaultValue to avoid confusion.

from here

so it looks like the default value entry’s for the device handler should be removed because they aren’t designed to be saveable. it looks like for some reason you can save them on an iPhone, but in android you cant. @zcapr17

right you lot, Ive fixed this on android now! Any of you struggling to use this device handler on android can rejoice, no need to use an iPhone or the IDE which sucks balls

The code in the following link removes the default values from the code (the text stikll tells you what the default value should be, but the options are not pre-populated. this is what breaks the android version

if you’ve been trying to use this before you may need to go into the IDE and remove the device, then re add it. although it will work if you have existing dimmers working, just replace your device handler with this one and if your using android, you will be able to add more dimmers via the smart app and not need an ios device.

@rmbhatia and @zcapr17 I’ve put this on my personal gist with the modifications, but hopefully you could update your code, basically if you remove the default value from your input fields in settings it allows android to work, example below, quite a small change:


    input name: "param10", type: "number", range: "0..32767", defaultValue: "0", required: true,
        title: "10. Timer functionality (auto - off). " +
               "This parameter allows to automatically switch off the device after specified time from switching on the light source. " +
               "It may be useful when the Dimmer 2 is installed in the stairway.\n" +
               "Available settings: 0 - Function disabled,\n1-32767 - time to turn off measured in seconds (1s-9.1h).\n" +
               "Default value: 0."

becomes this

    input name: "param10", type: "number", range: "0..32767", required: true,
        title: "10. Timer functionality (auto - off). " +
               "This parameter allows to automatically switch off the device after specified time from switching on the light source. " +
               "It may be useful when the Dimmer 2 is installed in the stairway.\n" +
               "Available settings: 0 - Function disabled,\n1-32767 - time to turn off measured in seconds (1s-9.1h).\n" +
               "Default value: 0."

I’m a fairly new ST user and have bought one Fibaro Dimmer2 to experiment with.
Have got it working on a toggle switch using imported code, will get a momentary to try.
Two observations with the toggle switch:
[1] Have to toggle it twice to cause any action (on/off)
[2] When switched off via the toggle, it dims to 1% rather than fully off.

Have tried 2 versions of the code, the original and Steve’s. I’ve set Param20 = 1 (toggle).
Will see whether a momentary switch behaves more as expected.
Steve - Do I really need to manually set each and every param by hand?

Note: I wired the dimmer for 3-wire setup, although this was only a 1-way switch. The 2 neutrals were in a connection block, which I believe tells me its the 3 wire setup.
Oh and its dimming 6 x 40w bulbs, not LEDs. 240W load.

Any comments appreciated.

Updated 23 Jan: RESOLVED:
Looks like I was just suffering the Android IDE problem that Steve was referring to.
After updating the Handler code (removed all default values) and manually typing in each parameter (slightly tedious) the dimmer is now functioning as expected with a toggle switch. No longer dims to 1%.


I have purchased the Fibara 212, and wired it in. It seem to calibrate, however then I tried to pair it and nothing appears in Smarthings. The light do apart to work and with a single switch is turns on and a triple switch it turns off. It is a standard Irish/UK switch, one position for on and one for off.

However to simplify it, i have even removed the face plate again and am using the B button on the device to try and set it to pairing mode, however still no success.

Any ideas?

Also, i have not added any custom code etc. yet as I am only trying to get it to pair at this stage. I was thinking it would appear as a thing first and then I change it in IDE. Is this correct, i do I add code first?

Hello #rmbhatia,
How to pair your device ?
I bought Fibaro Dimmer2 FGD-212 EU v3.4 and fail to pair with Smartthings Hub v2 UK - Firmware Version 000.016.00009.
My Hub does not find any device …

Add the device handler first just to be sure as that seemed to help me pair it, though in principle it should still appear as a ‘Standard Dimmer’ or something like that without the DH installed.

Hi guys - new Smartthings user here :). New to the world of device handlers, smart apps and what not. However, I think I’m slowly getting the grip on things. However, I’m running into an issue with my dimmers… And I feel I’m outmatched so maybe you guys can come to the rescue!

I’m trying to pair my already existing Fibaro Dimmer 2 unites that I’ve hooked up to a traditional 2-wire system without a neutral. I’ve used the official Fibaro video which has worked for me with a different Zwave controller. The pairing bit works perfect, the adding the device handler via IDE works and I can even brilliantly control the dimmer through both the app and Alexa. However, I need to move the hardware light switch UP AND DOWN to switch the light either off or on. The girlfriend doesn’t agree :wink:

My other ZWave controller immediately picked up on the right settings after I edited my settings to ‘Toggle switch’ so I thought ‘let’s try out the same’. However, I’m probably doing something wrong as I simply cannot get the switch to behave as toggle switch. I’m by no stretch of imagination an expert on this stuff… I’m really trying to do my best by looking into all forum topics I can find…however…I really don’t seem to be able to get this to work. Hence I need your support. Help!

I’ve configured the parameters as followed:

Parameter 20: Dimmer 2 operation: 1 (toggle)
Parameter 32: On/Off mode: 2 (auto)

I didn’t touch any of the other parameters assuming that they will be automatically populated by the default values from the device handler (is that the right call?)

I’m using the device handler created by @hajar (massive thanks btw!):

FYI: I created the device handler using the feature ‘From code’ within IDE. Hope this is the right way.

From what I have seen, if you were using iOS the first time then it will use the default values correctly, but if using Android then you need to log into the web dashboard and manually populate all of the values for every setting, before the settings are actually saved (i.e. Defaults don’twork). Hence try adding every setting on iOS/web and hopefully that will then save, so that you can update the values to their correct settings (and use Android from this point onwards).

Having just got my first Fibaro 2 dimmer installed and working on a basic 1-way light, I’m looking to buy more for the rest of the house. In particular I want to control several sets of LED spotlights, each of which has two 2 way switches.
However, I may struggle to get the Dimmer into the backboxes so would like to install in the celing/loft space.
The house has only just been rewired as part of a rennovation - so assuming that wiring is UK “standard”. There are neutrals in the switches.

Anyone got the same setup working - or see any obvious problems with this setup:

  • Fibaro 212 installed in ceiling
  • Two-Way : 2 linked momentary switches (3 position)
  • 5 LED spotlights (8w x 5) - So probably going to need a bypass

Assuming I can install in ceiling, do I need to identify the first of the 5 spotlights. I assume it can’t go just anywhere in the chain.
Also, I assume only 1 bypass needed per dimmer, as opposed to one per spotlight ?


UPDATE 26 Jan:
I read on Vesternet that the 3-position momentary switches need 3 cores between switch and dimmer, so you can only install the dimmer in the ceiling if you have 3 cores between switch and ceiling. Otherwise you can use the basic momentary switches.
So time to dig out the switch pattress box a little deeper and squeeze the dimmer in.

Have any of you on the other side of the pond had any luck setting up Associations with the Fibaro Dimmer 2 without a Fibaro Home Center? I need to establish a virtual 3-way with two Fibaro Dimmer 2 (US) modules. i’ve tried various SmartApps and Rules (Dim with Me, Dim and Dimmer, etc.) but the lag is not acceptable. My setup includes a ST hub and minimote. Each Fibaro is wired according to their instructions using on-off-on switches, configured as RollerBlind in the DH, using S1 and S2 on the Fibaro dimmer. both switches properly control the lights to which they are physically wired. but for the life of me, i cannot establish a direct association. i’ve read every post i can find on virtual 3-ways and the Fibaro dimmer. This should be straightforward but it is kicking my butt! Because this is a US model, i’m using the device handler from @erocm1231 in this thread: [RELEASE] Fibaro Dimmer 2 (US). and i followed @duncan process in this thread using an Accessory switch type: Evolve LTM-5 transmitter to LRM-AS association. no luck.

The Fibaro instructions only provides directions to establish associations using the Fibaro Home Center, which i do not have. and i’ve been unsuccessful in using the minimote to establish the association. When i asked Fibaro tech support for help, they pointed me back to ST.

Fibaro uses association groups 2 and 3 to associate on/off and dimmer functions (respectively) from S1 and groups 4 and 5 to associate on/off and dimmer functions from S2. Both S1 and S2 are required when using an on-off-on switch. The fibaro instructions do not recommend changing association group 1. I need both on/off and dim capabilities on the target switch from the Accessory Switch. Please Help!

Is this what you’re after?

Thanks man! I can confirm this works! Awesome

If you have a neutral then you will not need the Bypass. The Bypass allows the dimmer to draw power a tiny amount of power through the lights without the lights switching on - used in 2-wire setups. If you have a neutral then the Dimmer can just pull power between live and neutral, hence doesnt leave the lights flickering.

As for your setup, that seems ok, though you mention that your two-way switches are 3 position momentary? - Does that mean you have a central-off position, plus up and down clicks where it returns to off? If so that might make your installation more complex, since that would imply you already have a lighting controller converting momentary light presses into toggle power for the lights…

If you just have 2 regular 2 way toggle switches, then in the ceiling you need to have the ‘live’ going to the switches (which you need to disconnect from live and plug into the fibaro), plus switched live back from the switches, plus live and neutral. If you actually do have momentary switches then we will need to know more about how your lights are wired.


No, right now its 2 basic 2-way toggle switches - but I’d like to replace them with 3 position momentary so I can dim either one up or down using the Fibaro.

Yeah, I drew up a diagram this morning to get my head around it. I’m no sparky. What threw me is that the ring goes into/through each switch, hence more cables than I expected to see. In addition to the ring in/out, there is 3-core between the two switches plus the 2-core output to the spotlights from the switch. So 4 cables, total of 9 cores (ignoring earth) all for a single gang toggle switch.
Anyway, since its only 2 core from switch to the physical lights, I think I need to put the dimmer in the switch.
I think I’m getting there. Famous last words.


Yup indeed, the main switch is where the dimmer unit would need to go. If Ive got it right this is how you would connect the cables for momentary switches:

And this is how it would look for toggle switches:

P.s. Excuse the terrible sketches, was done on my phone!