Fibaro Dimmer Double Click Action


#1

I have Fibaro Dimmers installed in the house with toggle switches. Everything is working very well. The question I have is if anyone managed to assign other actions to double clicks? For example, in my bedroom there is a wall switch that controls ceiling lights. It would be nice if with double click it would be possible to switch on small bedside lights, instead of ceiling lights. So far I haven’t found a way of registering double clicks on a Fibaro Dimmer and processing them in ST. I tried Double Tap and variations of it like Better Double Tap etc but none of them seem to react to double clicks of the wall switch that controls Fibaro Dimmer.

If anyone has any ideas or suggestions I’d be very grateful. Don’t mind coding it up via device handler or smartapp as well if anyone has a good suggestion of how it could possibly work in ST infrastructure.


Fibaro Dimmer 2 Integration
Fibaro 2 Dimmer (212 not 211)
Will I need a bypass for my Fibaro FGD-212 install?
Fibaro 2 Dimmer associated with a permantely wired Fibaro RGBW
Is there a really smart dimmer out there?
(UK) Plug sockets and light switches
Light switch with energy reporting?
#2

After some search on the forums it turned out there is no solution to it, although a few requests in the thread below. I then decided to try to develop my own solution to the problem. Got inspired by the ideas in the button controller ([Release] Z-Wave.me, Popp, & Devolo Wireless wall Controller & Key Fob (EU), with button controller dimming apps and CoRE integration) and after a few hours of poking managed to crack it.

So if anyone wants to use S2 or double or triple click actions on Fibaro Dimmer 1 or 2 have a look at this code, which I made working in my own setup:

Hope this will be useful to the community. Enjoy.


New installation - 20 or so micro dimmers - advice needed
Fibaro 212 problems
(John Crighton) #3

That’s fantastic! This is going to unlock a whole new level of automation for me, as I have Fibaros and momentary switches everywhere in my house.

Well done @hajar!


#4

Well, the code I posted is for toggle switches. So you would need t adjust it a bit, but it should be very straightforward. Two things you need to change:
1)Parameter that controls Fibaro Dimmer if it works in toggle or momentary mode. Set it to momentary mode.
2)Review the manual of Fibaro Dimmer 2 to see what the differences in triggered scene IDs there is for toggle and momentary switches and add those to the code to generate the events you are after if I didn’t cover all of the scenes. I’ll try to do that tonight and push the code update if you don’t do that before me. :slight_smile:
Let me know how you’re getting on with this new capability of Fibaro Dimmers.


(John Crighton) #5

I’m ok with parameter changes, I can already see where I need to change them in your code.

Looking forward to having a play when paternity leave kicks in!


#6

I just pushed out an update which allows to control all of the Fibaro Dimmer 1 and Fibaro Dimmer 2 parameters directly in ST app, without any need to fiddle with the code.

Also considerably simplified the code of the device handlers and smartapp. Removed button capability of the dimmers and just added an attribute for handling scenes. Also one smartapp can now handle both types of dimmers.

Thinking about what rules now to assign to those extra capabilities of fibaro dimmers. For example, double click on any of the switch in the staircase makes all lights in the staircase to come on or off. Quite handy.


(John Crighton) #7

Great to see you’re really getting to grips with this!

I’ve just about began to experiment. My first job - I have a double momentary switch in my living room, S1 and S2 connected to two different switches. Currently S1 controls the main light, S2 does nothing. I’d love S1 to retain it’s functionality and S2 to control a lamp in the corner which contains a smart bulb.

Perhaps after that, a double tap of the downstairs hall light would carry out the ‘good night’ procedure and switch all d/s lights off.

Exciting times!


(John Crighton) #8

I’m a bit stuck here. I think I’ve got the parameters right, but need to test.

I’ve not worked with scenes before. Could I achieve what I want with scenes? How do I program a scene in?


#9

No worries. Let me help you. Its quite simple. You should definitely be able to achieve it. This is a high-level overview of what you need to do:

1)Install the Fibaro Dimmer 1 or 2 device handlers in your ST IDE, depending on which type of dimmers you are using and switch one of your dimmers to the new device type. First make it work with one, then you can do the same with the rest.

2)Open ST app and enter the settings of the device, where you should see all dimmer settings configurable. Adjust them to what you are usually using. If unsure, check which parameters were set in your previous device type. For momentary switch you need to set parameter 20 to 0. In order to enable scenes you need to set parameter 28 to 1.

3)After you finish setting the parameters of the device, open “Recently” tab of the dimmer in ST SmartApp. This is where you can watch what is happening to your dimmer when you try single, double or triple taps on both S1 and S2. Try switching the lights on/off double/triple taps. You should see messages like “Scene id 25 was activated”. If you do see such messages then all good, you have successfully enabled scenes functionality of your Fibaro Dimmer.

4)The next step is to start listening to those scenes activations and do something about them. For that I have created a very basic smartapp, which allows you to turn on/off/toggle any switch capable device. It is very easy to extend the app with other types of devices that you want to control via code or to use virtual switches for routines and then you don’t need to bother with any additional code. So once you installed the app you need to choose your Fibaro Dimmer (or multiple dimmers) that you expect to activate scenes. Choose which scene ids you’d like to listen to and choose which switches you’d like to be turned on/off/toggled when those scenes are activated. You can install as many instances of the app as you need, if you’d like to create lots of different rules for different scenes or Fibaro Dimmers.

And that’s it. You can start enjoying extra functionality of your dimmers. I also have a double switch, where 1st switch controls my kitchen lights and 2nd switch had nothing to do. Now I configured it to control lights in the hallway. Works like a charm. Of course you need to make sure that your second switch is connected to Fibaro Dimmer S2 in order for it to cause dimmer to activate scenes.

Let me know how you’re getting along with it. Happy to help more.


#10

When trying to change parameters using your device handler I just get: "Please fill out all required fields"
I have entered all fields, all nice and blue. But I still get this error


#11

Hm, very strange. I don’t seem to have such problem. Which field is it complaining about do you know? It should mark it as red normally. Do you have the latest app and firmware updates?


#12

When I access the parameter page, parameter no11, 24, 25, 27 is red. I fill in these and they turn blue, but still get the error when I hit “Done”


Fibaro 2 Dimmer (212 not 211)
#13

Hm, these parameters are “single choice” parameters and if you choose one of the options you should not have the problem. But obviously you do, but I am clueless why this might be happening. Just tried changing these parameters myself and everything seem to work as expected.

Did you ensure you have the latest firmware and app installed? If that doesn’t help, then another idea would be to try to remove the device completely and then add it again. Be careful with device removal though, don’t do it if you don’t know how to re-add a Z-Wave device. If you force the removal, you might not be able to easily add it back in again.


(John Crighton) #14

I’m not having this problem either, I’m leaving plenty of the parameters blank and it’s fine. Is there any possibility you’re entering codes which aren’t valid?

@hajar - I’m having difficulty in getting S2 to send back any scene IDs. I have parameters 28 and 29 set to 1, all others left as default. Is there anything else I should be setting here?

Interestingly 29 doesn’t seem to swap the switches, which I thought it would.


#15

Is your second switch correctly wired to S2?
Here is the dump of my non-default settings for Kitchen, where I use S2, may be it will help to find the differences:
parameterNumber: 13, size: 1, scaledConfigurationValue: 1 // Force auto-calibration of the load without FIBARO Bypass 2
parameterNumber: 19, size: 1, scaledConfigurationValue: 99 // Forced switch on brightness level
parameterNumber: 20, size: 1, scaledConfigurationValue: 1 // Enable Dimmer to work with Toggle Switch
parameterNumber: 26, size: 1, scaledConfigurationValue: 0 // S2 can control dimmer as well
parameterNumber: 28, size: 1, scaledConfigurationValue: 1 // Scene activation functionality
parameterNumber: 29, size: 1, scaledConfigurationValue: 0 // S1 operates as S1, S2 operates as S2
parameterNumber: 30, size: 1, scaledConfigurationValue: 2 // 0=forced leading edge control, 1=forced trailing edge control, 2=control mode selected automatically (based on auto-calibration)
parameterNumber: 32, size: 1, scaledConfigurationValue: 0 // On/Off Mode (0=Dimmer,1=On/Off,2=Auto)
parameterNumber: 35, size: 1, scaledConfigurationValue: 0 // Auto Calibration (0=No after Power On, 1=On First Power On, 2=On Each Power On)
parameterNumber: 39, size: 2, scaledConfigurationValue: 350 // Power limit - OVERLOAD 1-350
parameterNumber: 54, size: 1, scaledConfigurationValue: 1 // 0=Self-measurement inactive, 1=Self-measurement active

I wouldn’t leave any other parameters blank, just set them to default values.

Regarding 29, it does definitely flip S1 and S2 and you should see that in the change of the scene IDs that get activated. But the change isn’t instant - it takes about 30s to settle in once you press done.


#16

Switched from my android phone to my iPad. There it’s working just fine. Strange…

Another question, I have already setup most of my dimmer2’s with config parameters in the code or by auto calibration. Is there a way to readout the parameters already loaded in the dimmer2. If I switch to your device handler and just want to change one parameter, it will change all the parameters listed in the app and override my previous parameters/configuration


#17

Hm, interesting. I don’t have an Android device and so cannot check it. But there is nothing in the developer documentation that behaviour of iOS and Android with regard to preferences of device handlers should be different. So must be a bug in the Android app then.

Regarding your question: my suggestion is to just take a look into the code of your device handlers, check what parameter settings are there and type them into the preferences of the new device handler. Basically just copy parameter settings from old device handler code to new device handler preferences. You just need to do it once and that’s it. If you copy the parameters one to one, then it should not change behaviour of your dimmers. It might only trigger re-callibration (if the respective parameter is set so).


(John Crighton) #18

Ok, so I tried manually tapping the dimmer 2 connectors with a wire, and got the scene commands coming through just fine.

I’ve taken apart the rocker switch, put it back together, and it now works fine too. Looks like there may have been an assembly defect.

I’m within sniffing distance, nearly there!


(John Crighton) #19

Yes, absolutely brilliant!

I’ve got this working now, S1 maintains manual control (sends scene commands, but I choose to ignore them). All the usual double taps, hold to start at a low dim, hold to dim options are there for S1. A tap of S2 turns the lamp on or off (Aeotec RGBW LED bulb).

Great stuff, I’m very happy.


#20

Lovely, very happy to have helped with the challenge after you first posted the query a few months back :slight_smile: