more G-Labs products

Author Topic: Multiinstance channel Fibaro RGBW441  (Read 5619 times)

February 18, 2014, 05:34:34 PM
Read 5619 times

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi Gene,
 I sent you the Fibaro RGBW scripting that you integrated in HG.

I saw you have made some changes about ZWave MultriInstance scripting.
But The Fibaro RGBW didn't answer correctly I think on the   MiltiInstance GetCount REQUEST.
I join to you some logs occured when I use SetUp in the Module addtion in a Group.
In these logs, I have stop WakeUp Notify Task. And Had Prgram Notify in multiinstance scripting fot to be sure that the GetCount is sent.

In the case there is no way to get correct answer from the node, I can modify FibaroRGBW scripting to add automticaly the 5 virtuals modules needed to play with colors and programs.

Cheers.
Dani

February 18, 2014, 06:58:34 PM
Reply #1

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Dany,

try updating the WakeUp program with this code:

Code: [Select]
When.ModuleParameterChange((module, parameter) => {

  if (parameter.Name == "ZWaveNode.WakeUpNotify")
    {     
      var nodeinfo = module.Parameter("ZWaveNode.NodeInfo");
      if (nodeinfo != null)
        {
          // nif contains all command classes supported by this module
          string nif = " " + nodeinfo.Value + " ";
          if (nif.Contains(" 84 ")) // does the device support WakeUp ?
            {
                if (nif.Contains(" 60 ")) // MultiInstance
                {
                    Program.Notify("Z-Wave Node WakeUp", module.Instance.Name + "<br>" + module.Instance.Address + " MultiInstance Get");
                    // query first 4 instances
                    for (int instance = 1; instance < 4; instance ++)
                    {
                        if (nif.Contains(" 30 ")) // Sensor Binary
                        {
                            module.Command("MultiInstance.Get").Execute("Sensor.Binary/" + instance);
                        }
                        else if (nif.Contains(" 31 ")) // Sensor MultiLevel
                        {
                            module.Command("MultiInstance.Get").Execute("Sensor.MultiLevel/" + instance);
                        }
                        else if (nif.Contains(" 25 ")) // Switch Binary
                        {
                            module.Command("MultiInstance.Get").Execute("Switch.Binary/" + instance);
                        }
                        else if (nif.Contains(" 26 ")) // Switch MultiLevel
                        {
                            module.Command("MultiInstance.Get").Execute("Switch.MultiLevel/" + instance);
                        }
                        //Pause(.5);
                    }
                }
                //
                // query battery level
                if (nif.Contains(" 80 ")) // Battery
                {
                    Program.Notify("Z-Wave Node WakeUp", module.Instance.Name + "<br>" + module.Instance.Address + " Battery Get");
                    module.Command("Battery.Get").Execute();
                    //Pause(.5);
                }
                //
                Program.Notify("Z-Wave Node WakeUp", module.Instance.Name + "<br>" + module.Instance.Address + " Basic Get");
                module.Command("Basic.Get").Execute();
                //Pause(.5);
            }
        }
      //
      return false; // do not process this event any further
    }

  return true; // continue processing event
});

Program.GoBackground();

Basically I made the WakeUp program proceed with querying the node only if it really supports WakeUp command class.
Let me know if this fixes the issue.


February 18, 2014, 07:49:47 PM
Reply #2

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
As you can see in those logs, 84 is not present in the NodeInfo.

The node doesn't answer to GetCount anymore.

Cheers
Dani
« Last Edit: February 18, 2014, 07:52:47 PM by dani »

February 18, 2014, 10:48:17 PM
Reply #3

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Can you try manually calling

Code: [Select]
http://192.168.0.2/api/HomeAutomation.ZWave/48/MultiInstance.GetCount/Switch.Binary
or
http://192.168.0.2/api/HomeAutomation.ZWave/48/MultiInstance.GetCount/Switch.MultiLevel

replace ip and node address with yours.

This is log from my dual aeon switch:

Code: [Select]
SPO < 01 09 00 13 30 02 72 04 05 0B AF
SPI > 06 01 04 01 13 01 E8
SPO < 06
SPI > 01 05 00 13 0B 00 E2
SPO < 06
SPI > 01 0E 00 04 00 30 08 72 05 00 86 00 03 00 11 2E
2014-02-18T21:31:42.2222400+01:00       HomeAutomation.ZWave    48      ZWave Node      ZWaveNode.ManufacturerSpecific  0086:0003:0011
SPO < 06
2014-02-18T21:31:42.2667350+01:00       HomeAutomation.ZWave    48      ZWave Node      ZWaveNode.ManufacturerSpecific  0086:0003:0011
2014-02-18T21:31:43.3790440+01:00       MIG.Gateways.WebServiceGateway  192.168.0.6     api/HomeAutomation.ZWave/48/NodeInfo.Get/1392755506935  HTTP    GET
SPO < 01 04 00 60 30 AB
SPI > 06 01 04 01 60 01 9B
SPO < 06
SPI > 01 14 00 49 84 30 0E 04 10 01 25 31 32 27 70 85 72 86 60 EF 82 00
2014-02-18T21:31:43.5956640+01:00       HomeAutomation.ZWave    48      ZWave Node      ZWaveNode.NodeInfo      04 10 01 25 31 32 27 70 85 72 86 60
2014-02-18T21:31:43.6159880+01:00       HomeAutomation.ZWave    48      ZWave Node      ZWaveNode.WakeUpNotify  1
SPO < 06
SPO < 01 0A 00 13 30 03 60 04 25 05 0C 9D
SPI > 06 01 04 01 13 01 E8
SPO < 06
SPI > 01 05 00 13 0C 00 E5
SPO < 06
SPI > 01 0A 00 04 00 30 04 60 05 25 02 87
2014-02-18T21:31:43.8831860+01:00       HomeAutomation.ZWave    48      ZWave Node      ZWaveNode.MultiInstance.SwitchBinary.Count      2




February 19, 2014, 01:25:43 AM
Reply #4

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
OK, I will try this with multiswich fgs221 and multilevel  frgbw441 in the afternoon.

Gold night
Dani

February 19, 2014, 02:51:40 PM
Reply #5

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi Gene,

You can find here the logs file of the 2 calls of API HG fonctions using AEon Key ZWave V2

Node 3 is Multiswitch FGS-221
Node 4 if MultiLevel FGRBGW-441

Cheers.
Dani

February 19, 2014, 04:03:20 PM
Reply #6

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Ok... just wondering what happen if you try a

http://localhost/api/HomeAutomation.ZWave/4/MultiInstance.GetCount/Switch.Binary

on node 4. I think I must misunderstood that part of z-wave api (well no documentation about it =/).

Cheers,
g.


February 19, 2014, 05:26:01 PM
Reply #7

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi Gene,

I thought same as you and I had made your request before, but for me there is no difference, no more answer from Node FGBRW-441 as you can see below

Cheers
Dani

February 19, 2014, 05:49:53 PM
Reply #8

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Ok... I think that for now, as a work-around, you can accomplish the virtual modules creation by comparing the manufacturer specific string, that in any case identify your fibaro hardware, so you know how many instances are to be created and associated to your fibaro rgbw widget.
Once you get this working, send the new script so I will include it in hg.
Pheraps later we'll find a solution and proper implementation of this part of the z-wave protocol.

Cheers,
g.

February 19, 2014, 06:11:17 PM
Reply #9

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Ok Gene.

I will change FibaroRGBW source code. And yes let's see if we have more informations later.
I think this module has some special specifications. Because on the Net this node is actually only implemented on HomeCenter 2. And now on HG.
I don't now so much developpement on Android. But I am interesting to implement The RGB interface you are using on PhilipsHue for this module on SoftPhone.

Cheers.
Dani
 

February 19, 2014, 07:17:51 PM
Reply #10

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi Gene,

You can find following the new script of FibaroRGBW that insert automatically the 5 virtuals nodes needed.

Cheers
Dani

February 21, 2014, 11:34:35 AM
Reply #11

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi Gene,

As I write post before I am interesting to implement The RGB interface you are using on PhilipsHue for FibaroRGBW on SoftPhone.
I got your source code for Android, and I integrate Android SDK 4.4.2 in eclipse under Linux.
But When compile I get many errors due to UpnpManager.java for exemple :
AndroidUpnpService cannot be resolved to a type.
Can you give an issue for these errors and others ?
Thank's for your work.

Cheers.
Dani
« Last Edit: February 21, 2014, 11:39:00 AM by dani »

February 21, 2014, 02:26:55 PM
Reply #12

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi dani,

try opening the project with Android Studio instead of eclipse.

g.

February 24, 2014, 07:52:35 PM
Reply #13

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
Hi Gene,

I have made some changes in FibaroRGBW.hgx scene.
And I can send you some code for use this module in HomeGenie Android Widgets.
Can I send send you by this forum.
Some source code are new files.
But I have to modify some parts in  code of GenericWidgetAdapter.java -> I can explain you in text file.
Tell me what way you prefer.

Cheers
Dani

February 24, 2014, 08:32:51 PM
Reply #14

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Send me here the new hgx, so I will include it in r340.
For the android app it would be cool using
https://help.github.com/articles/using-pull-requests

Cheers,
g.