[RELEASE] Fibaro FGS-213 Single Switch 2 (not 223)


(Robin) #1

I was amazed to find there was no working DTH for the Fibaro 213 Single Switch 2… So I made one myself.

I have listed all the various parameters and descriptions in the device preference page, so they can be quickly updated as required.

Unfortunately I cannot get the scene ID’s to report properly… I have left the code in place and if anyone knows how to get this aspect working please let me know. (I’ll tinker some more at the weekend)

Sorry if I have GitHub setup wrong, it’s my first upload!

This is for the 213 (single switch) not the 223 (double switch)

If you are looking for the DTH for the 223 then look here:

New Fibaro switches FGS-213/223
Guide me!, add new device Single Switch 2 FIBARO
ST compatible Single Switch Device (UK) (Comments on Fibaro 213 or alternatives?)
New Fibaro switches FGS-213/223
Working on a solution for bringing a handicapped stair glide up/down
(EinarS) #2

Great work!!! @RobinWinbourne.
My FGS-213 is at the moment out of the wall, due to the lack of this device hanlder.
This is a re entry next week.
Your the man.
PS dont need the scenes for this on my self.

(Nigel Williams) #3

Top work Robin

Does anyone know of a device handler for the Fibaro Single Switch (pre Gen5)?

(Robin) #4


Do you mean the single relay switch?

I’m not aware of a previous version of the non-relay switch?

Have you got a link to the manual for the device you refer to?

(EinarS) #5

Works great @RobinWinbourne
thx a bunch.

(Nigel Williams) #6

Thanks Robin
It works a treat, and your advice to Eric means the Single & Duel Switches are reporting their energy uses :wink:
Is your handler in Github so we can get any future updates?

(Robin) #7

It’s on GitHub but to be honest I’m not sure if it’s setup correctly to push out updates.

Guess if ST ever break the handler you’ll know to look for an update, otherwise I can’t see it changing.

(Craig Taylor) #8

I’ve used a chunk of code from elsewhere to work out how to get the Central Scene Handler to publish events:

def zwaveEvent(physicalgraph.zwave.commands.centralscenev1.CentralSceneNotification cmd) {
    log.debug("sceneNumber: ${cmd.sceneNumber} sequenceNumber: ${cmd.sequenceNumber}")
     sendEvent(name: "scene", value: "$cmd.sceneNumber", data: [switchType: "$settings.param20"], descriptionText: "Scene id $cmd.sceneNumber was activated", isStateChange: true)

Unfortunately, looking at the debug info, we cant work with the same scene numbers as Hajar, so if you use that SmartApp as your hook for flicking Virtual Switches, you’ll need to make a fork of that too which will let you configure lower scene numbers.

(Robin) #9

Can it be seen by CoRE?

(Craig Taylor) #10

No idea. I missed the boat on CoRE. The SmartApp was pulled before I was even aware of it’s existence.

What I would say is that the generic debugger in the code doesn’t post any values. I will take another look tomorrow, to see what CoRE pulls data from and see if its informative.

(Robin) #11

Errrrr… CoRE had not been pulled???

I’m in Taiwan for a week but will experiment myself when I get back.

(Craig Taylor) #12

Oops. My mistake. Thought I’d read that on here. I’ll take a look then. Much easier with the code

(James) #13

Trying ti implement this app, the IDE returns

No signature of method: script149304907677393469603.metadata() is applicable for argument types: (script149304907677393469603$_run_closure1) values: [script149304907677393469603$_run_closure1@77c1fa65] Possible solutions: getMetadata(), getState(), setState(java.lang.Object), metaClass(groovy.lang.Closure)

and won’t create it. Help! James :slight_smile:

(Robin) #14

Working good on my end, did you copy from the raw GitHub view and ensure you got the whole lot of code?

(James) #15

Yes, copied the raw and got all the code. Odd. I’ll try again from scratch and see what happens.James

(Robin) #16

I suspect you’re pasting it into a new smartapp page instead of a new device handler page.

(James) #17

Arrrgh! I had a Homer Simpson moment !! All ok now. Thanks :slight_smile:

(James) #18

OK I installed the device handler. I noticed three issues… 1. Any attempt to alter the configuration (top right * button) results in ‘Fill out all required fields’ red banner error on touching Done, and the changes, if any, can’t be made. This happens even if nothing is altered. 2. The Config icon, next to the power usaage display doesn’t appear to do anything. 3. The actual status shown in My Things is a bit flaky compared to the actual state of the switch. It sometimes shows on, when it isn’t and off when it’s on, and can stick on ‘Turning on/off’ until tapped again.
However it does appear to be turning the device on and off, and I am setting up smartapps to test in an hour or so when it is dark here; the switch being used to control outside lighting.
Many thanks for your work in creating this device handler :slight_smile: It is very much appreciated.

James :slight_smile:

(Robin) #19

You’re using android which has a known ST bug. Default values in the device settings page cause the error and need to be set once in iOS to work.

You have two options

A) find a friend with an iPhone, install the ST app and log in, open and save the preferences page (just once) and it will then work on Android every time going forward.

B) go into the code and remove all of the default values.

Once you have done the above the configure button will work and thinks should settle down for you.

(James) #20

Thanks Robin :slight_smile: Will do the latter. Don’t know any Apple folk! Thanks again for your very valued help. Take care. James