HomeGenie Forum

Development => Bug reporting => Topic started by: nunofx on July 31, 2014, 12:04:25 AM

Title: Fibaro FGS-221
Post by: nunofx on July 31, 2014, 12:04:25 AM
Hi,

I'm new on the forum and HG and started to use it to automate home shutters and everything is working perfectly. Thanks Gene for this nice piece of software.

Now, I installed a FGS-221 double relay to control WC light and fan and noticed the following issues:
- Device specification is not retrieved from Pepper-One DB as you can see on the attached image.
- Virtual module widgets are not updated with the status notification coming from the device, though the physical module widget is (as you can see on the attached image).

Thanks + BRegards,
Nuno
Title: Re: Fibaro FGS-221
Post by: dani on July 31, 2014, 08:54:13 AM
Hi Nuno,

I'am using Fibaro F221.
Why did you said : Device specification is not retrieved from Pepper-One DB. The image shows the supported classes, so for me that' works.
And for the widgets : Why do you need to put lthe two switchs individually and mixed switch in the same group ?
For me I put only the inindividual ones and it works perfectly.sa you can see in the screenshot following

Cheers
Dani
Title: Re: Fibaro FGS-221
Post by: nunofx on August 03, 2014, 05:14:37 PM
Hi Dani,

In fact, the info is not read from DB. Look at the attached image from Fibaro shutter controller where you can see the parameter description.

I put the two switches individually and mixed switch in the same group because their change are not being updated. As soon as it works, I'll remove the mixed.

If I control the devices from HG using the widgets, the status is updated. However, If you control the device manually on the wall switch, its status is not reflected on the widget. Even the poll automation is not working for virtual devices (at least on mine).

Thanks + BRegards,
Nuno
Title: Re: Fibaro FGS-221
Post by: dani on August 18, 2014, 03:15:55 PM
Hi Nuno,

I agree with you when I control the device manually on the wall switch, its status is not reflected on the widget.

Hi Gene,
I join you following Z Wave trace of that problem.
I can help for any test or any trace.
 
Cheers
Title: Re: Fibaro FGS-221
Post by: nunofx on August 31, 2014, 07:20:36 PM
Hi Nuno,

I agree with you when I control the device manually on the wall switch, its status is not reflected on the widget.

Hi Gene,
I join you following Z Wave trace of that problem.
I can help for any test or any trace.
 
Cheers

Hi Gene. I'm also available for testing. I'm a noobie on HG but with some hints how to use debug mode, I can help ;)
Title: Re: Fibaro FGS-221
Post by: Gene on September 01, 2014, 01:22:30 AM
Hi there,

the issue is due to the fact there's missing code in the MultiInstance/Channel automation program.
To help completing the code follow these steps:

- associate the fgs-221 to node 1 (the controller)
- see fgs-221 documentation and enable level change reporting
- run homegenie in a terminal window to see debug messages from zwavelib
- press the buttons for activating the two channels and report back here the log

by looking at the log I will be able to add the missing piece of code.

Cheers,
g.
Title: Re: Fibaro FGS-221
Post by: dani on September 01, 2014, 12:43:09 PM
Hi Gene,

You can see my test report some topics upstairs. So I join you again the logs.

Cheers
Dani
Title: Re: Fibaro FGS-221
Post by: Gene on September 01, 2014, 01:37:20 PM
All right Dani,

found the problem. Actually ZWaveLib do not implement code for multiinstance encapsulated v2 switch binary/multilevel:

https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/ProductHandlers/Generic/Sensor.cs#L151

there was also a todo note about this. I'll be adding the code for the next update.
Can you file a issue to github?

Thanks!
g.
Title: Re: Fibaro FGS-221
Post by: dani on September 01, 2014, 03:20:26 PM
Hi Gene,

The source code that you give the link is sensor.cs but FGS-221  is not a multisensor but a multiswitch binanry equipement.
I don't understand what you ask me to do "Can you file a issue to github?"

Cheers
Dani
Title: Re: Fibaro FGS-221
Post by: Gene on September 01, 2014, 04:25:24 PM
oops... =) then the file is:

https://github.com/genielabs/HomeGenie/blob/master/MIG/Support%20Libraries/ZWaveLib/Devices/ProductHandlers/Generic/Switch.cs#L91

where multiinstance incapsulated (60 0D --> COMMAND_MULTIINSTANCEV2_ENCAP = 0x0D) is not handled at all.

Cheers,
g.
Title: Re: Fibaro FGS-221
Post by: dani on September 02, 2014, 11:21:34 AM
Hi Gene,

Yes I saw the source code. But when I look at it, It seems to me that the parameters are in the good place. Or do I make a mistake ?

Cheers
Dani
Title: Re: Fibaro FGS-221
Post by: Gene on September 02, 2014, 02:49:31 PM
Hi Dani,

I'll try to be more detailed. These commands should already work (at least for the master node status):

Code: [Select]
* Manual Switch ON/OFF Node 3 : Light 1
[17:55:06.698996] SPI > 01 09 00 04 00 03 03 25 03 FF 2B
[17:55:14.804490] SPI > 01 09 00 04 00 03 03 25 03 00 D4

can you confirm?

What I thought was not working is the multilevel binary switch:

Code: [Select]
* Manual Switch ON/OFF Node 3 : Light 2
[17:55:11.281813] SPI > 01 0D 00 04 00 03 07 60 0D 02 02 25 03 FF 46
[17:55:18.072644] SPI > 01 0D 00 04 00 03 07 60 0D 02 02 25 03 00 B9

because I don't see the event log in your file of the parameter ZWaveLib.MultiLevel.SwitchBinary or whatever it is called =)
Looking at the code it seems that it should work because the bytes offset to read the values is already correct (for multilevel sensors when a multiinstance encapsulation v2 is detected the value is read from a different offset).

So, was your log complete? Or did you cut-off some lines?

If the parameter change events are already working, then, as I thought in the beginning only the multilevel program have to be completed (that's good because we can test the program right away without need of updating hg itself).

Cheers,
g.

Title: Re: Fibaro FGS-221
Post by: dani on September 02, 2014, 03:20:08 PM
Hi Gene,

You are right, as I write before, the master node is updated.

My logs were complete. I don't remove any line, only add some comments.
So yes, for the instance 1 we receive only a basic line. and for instance 2 a multiinstance line.
I join a screenshot where the master in ON, but not the Node 3.1.

One question : I used Monodevelop but since the version of HomeGenie_linux.sln is in version 12 I can't load the project. under Debian Jessie. Have you an idea to correct that ?
 
Cheers
Dani
Title: Re: Fibaro FGS-221
Post by: Gene on September 02, 2014, 03:29:48 PM
So it's odd that the event is not showing.. it shoud be.
I am using Monodevelop 5 so perhaps the solution won't work with earlier versions. =/
You can try to search for some backport. Pheraps editing the .sln file and manually changing the version number, could also fix the problem.

g.
Title: Re: Fibaro FGS-221
Post by: dani on September 02, 2014, 03:41:15 PM
The logs don't show any data other than I have in the file I joined.
I think for the instance 1, the FGS-221 only send a basic line. So We need a specific to map a message for The node 3.1.
Only I don't know why the Node 3.2 doesn't work properely. The message is correct and the source code takes the different parameters in the good place.

For Monodevelop, under Jessie I have installed Monodevelop 4.0.12. And now I can load the project HomeGenie_Linux. Thank's

Dani
Title: Re: Fibaro FGS-221
Post by: dani on September 06, 2014, 04:36:58 PM
Hi Gene,

I had some log in the fonction : RaisePropertyChanged
The event goes until this function. as we can see in the log file joigned. But which way it must take after to go to http client ?

Cheers
Dani
Title: Re: Fibaro FGS-221
Post by: dani on September 11, 2014, 03:12:06 PM
Hi Gene,

For FGS 221 I have some code to add in switch.cs and in zwave.cs  for the manual switch problem. Otherwise the status is not correct in node X.1 and X.2 in the Control screen.

You can look at the file attached.

Cheers.
Dani
Title: Re: Fibaro FGS-221
Post by: nunofx on September 27, 2014, 10:41:41 AM
Hi Gene,

Any news on the integration of Dani patch?

Thanks + BRegards,
Nuno
Title: Re: Fibaro FGS-221
Post by: nolio on November 26, 2014, 03:47:30 PM
Hi,

Dani, your code work fine for you ? Does someone else try the Dany code ?
The better way to have the code in future release is probably to summit this code to gitub :
https://github.com/genielabs/HomeGenie

Bye
Title: Re: Fibaro FGS-221
Post by: nunofx on December 06, 2014, 09:07:45 PM
Hi,

Issue #59 (https://github.com/genielabs/HomeGenie/issues/59) created on github.

BRegards,
Nuno
Title: Re: Fibaro FGS-221
Post by: Gene on December 10, 2014, 07:53:20 PM
Hi everybody,

I've only included modifications to the ZWaveLib Switch.cs file. Did not change the ZWave.cs file because virtual modules are handled by the MultiInstance app so I rather modified the app to recognize multiinstance events and so raise the level change event for the associated virtual module.
Please give it a test as I cannot (disable the old app and import/enable this one).

g.
Title: Re: Fibaro FGS-221
Post by: nolio on December 10, 2014, 08:52:26 PM
Hi,
It's work for me.

I have 3 modules declare in HG :

Do you know why i can't put "ZWave xx.1" or "ZWave xx.2" in "type" Light ? My ZWave xx is light type.

Bye
Title: Re: Fibaro FGS-221
Post by: Gene on December 11, 2014, 12:43:16 AM
Hi nolio, in order to get "ZWave xx.1"  update the status you need the new ZWaveLib.dll (with Switch.cs modification proposed by dani).
I think the device type is reset to swith anytime the script is restarted because it recreate the virtual modules.
I updated the code so that if the virtual module already exists is is not created.
Let me know if it works.

g.
Title: Re: Fibaro FGS-221
Post by: nolio on December 11, 2014, 11:04:42 PM
Hi Gene,

I try this one. I have the status of xx.2 (after the lost of xx.1 and xx.2 and their name).
I set a name and type "light", but the icon if always "plug". So i try to force a refresh on web browser, and i lost the type and the name of this xx.2 ...

Bye
Title: Re: Fibaro FGS-221
Post by: nolio on December 12, 2014, 09:52:01 PM
I take a look in that code, and in the creation of the virtual module it seems there is 2 types define :
Can it be possible to get the type of xx to put the same type to xx.1 and xx.2 ? (to be sure to don't erase the type at each type the script is launch).

Something like :
Code: [Select]
if ( Modules.OfDeviceType("Light") { defaultType = "Light"; }
if ( Modules.OfDeviceType("Dimmer") { defaultType = "Dimmer"; }
...

I am not very sure about this ... :)
Bye
Title: Re: Fibaro FGS-221
Post by: nolio on December 15, 2014, 08:59:25 PM
Hi,
I try with the latest update (r443). It work fine for xx.1 and xx.2 (status on/off is updated in HG). And the name and the type is save. Great !

But As you can see in joint capture, the type is "light" but the icon stay to "switch".
Strange ...

Bye
Title: Re: Fibaro FGS-221
Post by: Gene on December 15, 2014, 11:16:35 PM
Hi nolio,

this is because the virtual modules are storing old widget settings.
Remove the Widget.DisplayModule property from both of virtual modules.

g.
Title: Re: Fibaro FGS-221
Post by: nolio on December 16, 2014, 12:09:39 PM
Hi Gene,
That's work ! Thanks.
Bye
Title: Re: Fibaro FGS-221
Post by: Bemie on February 22, 2015, 09:07:20 PM
I have bought the FGS 211 and tried to work with it
It operates fine when addressing it from Homegenie, but I am still (even after following this thread) have problems to get updates from local hardware switching. The virtual switch does not update based on action of local switching. I use version 478.

I installed the '93-Multi_Instance_Channel__Virtual_Modules.hgx' file from Gene. It resolved for me only the disappearance of the message 'response time'. It probably gets now an acknowledgement. But still usage of the local switch is not updated.

Also I noticed that swithing the combined virtual switch has no effect on the updates of seperated xx.1 en xx.2 virtual switches (provided a picture in the attachment)

Love the program, and learn a lot as an old guy. Hope you can find the time to help me and maybe others with this problem.
Title: Re: Fibaro FGS-221
Post by: nolio on February 23, 2015, 10:04:47 AM
Hi,
You bought a FGS-211 and not a FGS-221.

I see you can use the "S2" to a switch to have the status of a physical switch, is it your case ?

In brief, i think your are in the exact same case ...
Do you take a look at you log file ?
++
Title: Re: Fibaro FGS-221
Post by: Bemie on February 24, 2015, 04:27:48 PM
Dear Nolio,
Thanks for reaching out. I really appreciate it.

I know for sure I have the fgs 221 version. I did a typing error in my previous post. I have corrected it. My apologizes.
I have built http://www.domotique-fibaro.fr/uploads/gallery/album_99/sml_gallery_513_99_57952.png (http://www.domotique-fibaro.fr/uploads/gallery/album_99/sml_gallery_513_99_57952.png) exactly the same with separate power.

I installed hardware and used the pepper db to get the initialization right. As a result it correctly switches through the virtual switches. And it correctly switches locally through the hardware switch (S1 and S2). However, the hardware switches are not triggering an update to Homegenie.

I tried the hgx of Gene in this thread as well. They do work, however they are not updating my other two virtual switches (an action within the sub menu of xx is not updating either xx.1 or xx.2). And they too are not updated by hardware switching locally.

I have made a log. Between 3:50:03.711 - 3:50:34.733 I did hardware switching (I turned them on). And I turned them off again through software. Hope you understand what I am trying to explain to you. Any tip hint or help is much appreciated.
Thanks in advance.

Title: Re: Fibaro FGS-221
Post by: nolio on February 24, 2015, 11:33:09 PM
Ok that's clear.
I didn't use a lot the physical switch but i will do some try on my side.
Title: Re: Fibaro FGS-221
Post by: Bemie on February 25, 2015, 08:15:59 PM
Thank you for your reply.
If you could inform me whether it does work for you, I would really appreciate it.
Thanks in advance.
Title: Re: Fibaro FGS-221
Post by: nolio on February 25, 2015, 08:57:06 PM
I try. It seems to didn't work for me too.
So i launch HG in command line (to see the z-wave message) and after i can't reproduce again (so all work fine) ...
And i launch again HG without command line and still work ...

So finally it work fine for me ... ;)

You have 3 device "7", "7.1", "7.2", did your "7" is updated ?
Title: Re: Fibaro FGS-221
Post by: Bemie on February 25, 2015, 10:25:13 PM
Dear Nolio,
Thank you for your reply.
Please be patient with me (an old guy learning here), but what do you mean with HG in command line.
I use windows, and from a cmd line (dos environment) what program do you want me to start ? (sorry for the dumb question, but I do not know how to, but understand the purpose) Could you please help me out what it is you want me to type to get this zwave logs. (I tried some things but I must do something wrong, do I need to add a switch command?)

And to anwser your question: I updated 7.1 and 7.2 with help of Homegenie and Pepper db. When I noticed it was not working with the local physical switch I used the hgx from Gene (earlier in the thread). The 7 came to existence when I installed the hgx program from Gene. In it is a sub option to control ' main' , '1' or '2' either 'on' or 'off'. It is therefore almost the same as the seperated 7.1 and 7.2 with the exception to turn of the whole device. So the 7.x are all refering to the same 01 and 02 of the same fgs-221.

Do you think it is a bug, or did I do something wrong. I am getting a Raspberry Pi tomorrow, I will try it with that as well.

Again, thank you for helping.
Title: Re: Fibaro FGS-221
Post by: nolio on February 25, 2015, 11:14:52 PM
I use windows, and from a cmd line (dos environment) what program do you want me to start ? (sorry for the dumb question, but I do not know how to, but understand the purpose) Could you please help me out what it is you want me to type to get this zwave logs. (I tried some things but I must do something wrong, do I need to add a switch command?)
I have never use HG on windows, so i don't know. But you can wait to try on raspberry.
With the raspberry image :
Code: [Select]
And to anwser your question: I updated 7.1 and 7.2 with help of Homegenie and Pepper db. When I noticed it was not working with the local physical switch I used the hgx from Gene (earlier in the thread). The 7 came to existence when I installed the hgx program from Gene. In it is a sub option to control ' main' , '1' or '2' either 'on' or 'off'. It is therefore almost the same as the seperated 7.1 and 7.2 with the exception to turn of the whole device. So the 7.x are all refering to the same 01 and 02 of the same fgs-221.
A little bit weird, you have 3 time "on" on your "7" device ...
Wait and see, your raspberry install (with some luck), it will be better ...
Title: Re: Fibaro FGS-221
Post by: Bemie on February 26, 2015, 08:35:19 AM
Dear Nolio,
Thank you for the quick reply. I appreciate your help and patience.
I will keep you informed.



Title: Re: Fibaro FGS-221
Post by: bkenobi on February 26, 2015, 04:44:04 PM
I didn't read the whole thread again, but I believe the question was how to start HG with the full output for debugging within Windows.


That's it!  The output/debug info will be printed to the command prompt window.  You can also redirect the output to a file if you want to have it saved or you aren't watching it all the time (looking for an error at some point in time for example).  To do that, just start HG like this:

Code: [Select]
HomeGenie.exe > mono.log
Title: Re: Fibaro FGS-221
Post by: Bemie on February 27, 2015, 07:25:40 AM
Dear Bkenobi,
Thank you for your time and response. I will play with it.