@@ -135,7 +135,7 @@ Program.GoBackground();</ScriptSource>
135135 </ProgramFeature >
136136 </Features >
137137 <ActivationTime xsi : nil =" true" />
138- <TriggerTime >2015-11-29T17:52:28.92703Z </TriggerTime >
138+ <TriggerTime >2015-12-04T11:41:37.245454Z </TriggerTime >
139139 <Type >CSharp</Type >
140140 <IsEnabled >true</IsEnabled >
141141 </ProgramBlock >
@@ -255,7 +255,7 @@ For instructions see: http://developers.meethue.com/gettingstarted.html .</Descr
255255 <Group >Devices and Things</Group >
256256 <Features />
257257 <ActivationTime xsi : nil =" true" />
258- <TriggerTime >2015-11-29T17:52:28.939759Z </TriggerTime >
258+ <TriggerTime >2015-12-04T11:41:37.261897Z </TriggerTime >
259259 <Type >CSharp</Type >
260260 <IsEnabled >true</IsEnabled >
261261 </ProgramBlock >
@@ -429,7 +429,7 @@ To activate this widget specify a valid user <strong>Key</strong> th
429429 <Group >Weather and Enviroment</Group >
430430 <Features />
431431 <ActivationTime xsi : nil =" true" />
432- <TriggerTime >2015-11-29T17:52:29.076516Z </TriggerTime >
432+ <TriggerTime >2015-12-04T11:41:37.333313Z </TriggerTime >
433433 <Type >CSharp</Type >
434434 <IsEnabled >true</IsEnabled >
435435 </ProgramBlock >
@@ -501,7 +501,7 @@ while (Program.IsEnabled)
501501 </ProgramFeature >
502502 </Features >
503503 <ActivationTime xsi : nil =" true" />
504- <TriggerTime >2015-11-29T17:52:29.084289Z </TriggerTime >
504+ <TriggerTime >2015-12-04T11:41:37.348316Z </TriggerTime >
505505 <Type >CSharp</Type >
506506 <IsEnabled >true</IsEnabled >
507507 </ProgramBlock >
@@ -589,7 +589,22 @@ Program.Run();
589589 // basic get will returns current device level
590590 Modules.WithFeature("HomeGenie.ZWaveLevelPoll").Each((module) => {
591591 //Program.Notify("Z-Wave Level Poll", "Polling node " + module.Instance.Address + "< br> " + module.Instance.Name);
592- module.Command("Basic.Get").Execute();
592+ var nif = "";
593+ // node information frame
594+ if (module.HasParameter("ZWaveNode.NodeInfo"))
595+ nif = (" " + module.Parameter("ZWaveNode.NodeInfo").Value + " ");
596+ if (nif.Contains(" 26 ")) // 0x26 Switch MultiLevel
597+ {
598+ module.Command("SwitchMultilevel.Get").Execute();
599+ }
600+ else if (nif.Contains(" 25 ")) // 0x25 Switch Binary
601+ {
602+ module.Command("SwitchBinary.Get").Execute();
603+ }
604+ else
605+ {
606+ module.Command("Basic.Get").Execute();
607+ }
593608 return false; // do not break, continue iterating...
594609 });
595610 // pause between each poll
@@ -1102,7 +1117,7 @@ Program.GoBackground();</ScriptSource>
11021117 </ProgramFeature >
11031118 </Features >
11041119 <ActivationTime xsi : nil =" true" />
1105- <TriggerTime >2015-11-29T17:52:28.282814Z </TriggerTime >
1120+ <TriggerTime >2015-12-04T11:41:37.430432Z </TriggerTime >
11061121 <Type >CSharp</Type >
11071122 <IsEnabled >true</IsEnabled >
11081123 </ProgramBlock >
@@ -1149,7 +1164,7 @@ Program.GoBackground();</ScriptSource>
11491164 </ProgramFeature >
11501165 </Features >
11511166 <ActivationTime xsi : nil =" true" />
1152- <TriggerTime >2015-11-29T17:52:28.282758Z </TriggerTime >
1167+ <TriggerTime >2015-12-04T11:41:36.538223Z </TriggerTime >
11531168 <Type >CSharp</Type >
11541169 <IsEnabled >true</IsEnabled >
11551170 </ProgramBlock >
@@ -1498,7 +1513,7 @@ while (Program.IsEnabled)
14981513 </ProgramFeature >
14991514 </Features >
15001515 <ActivationTime xsi : nil =" true" />
1501- <TriggerTime >2015-11-29T17:52:28.596772Z </TriggerTime >
1516+ <TriggerTime >2015-12-04T11:41:36.745841Z </TriggerTime >
15021517 <Type >CSharp</Type >
15031518 <IsEnabled >true</IsEnabled >
15041519 </ProgramBlock >
@@ -1611,8 +1626,8 @@ Program.GoBackground();</ScriptSource>
16111626 <Description >Send to sleep after given delay (seconds, 0=disabled)</Description >
16121627 </ProgramFeature >
16131628 </Features >
1614- <ActivationTime >2015-11-29T17:53:35.775156Z</ ActivationTime >
1615- <TriggerTime >2015-11-29T17:53:35.805067Z </TriggerTime >
1629+ <ActivationTime xsi : nil = " true " / >
1630+ <TriggerTime >2015-12-04T11:41:36.736467Z </TriggerTime >
16161631 <Type >CSharp</Type >
16171632 <IsEnabled >true</IsEnabled >
16181633 </ProgramBlock >
@@ -1667,7 +1682,7 @@ Program.GoBackground();</ScriptSource>
16671682 </ProgramFeature >
16681683 </Features >
16691684 <ActivationTime xsi : nil =" true" />
1670- <TriggerTime >2015-11-29T17:52:28.660089Z </TriggerTime >
1685+ <TriggerTime >2015-12-04T11:41:37.012061Z </TriggerTime >
16711686 <Type >CSharp</Type >
16721687 <IsEnabled >true</IsEnabled >
16731688 </ProgramBlock >
@@ -1776,7 +1791,7 @@ Program.Run();
17761791 <Group >Messaging and Social</Group >
17771792 <Features />
17781793 <ActivationTime xsi : nil =" true" />
1779- <TriggerTime >2015-11-29T17:52:28.946235Z </TriggerTime >
1794+ <TriggerTime >2015-12-04T11:41:37.026948Z </TriggerTime >
17801795 <Type >CSharp</Type >
17811796 <IsEnabled >true</IsEnabled >
17821797 </ProgramBlock >
@@ -2114,7 +2129,7 @@ Currently limited to one client channel.</Description>
21142129 </ProgramFeature >
21152130 </Features >
21162131 <ActivationTime xsi : nil =" true" />
2117- <TriggerTime >2015-11-29T17:52:29.167596Z </TriggerTime >
2132+ <TriggerTime >2015-12-04T11:41:37.173839Z </TriggerTime >
21182133 <Type >CSharp</Type >
21192134 <IsEnabled >true</IsEnabled >
21202135 </ProgramBlock >
@@ -2212,7 +2227,7 @@ energy consumption.</Description>
22122227 <Group >Energy Management</Group >
22132228 <Features />
22142229 <ActivationTime xsi : nil =" true" />
2215- <TriggerTime >2015-11-29T17:52:29.404342Z </TriggerTime >
2230+ <TriggerTime >2015-12-04T11:41:37.466047Z </TriggerTime >
22162231 <Type >CSharp</Type >
22172232 <IsEnabled >true</IsEnabled >
22182233 </ProgramBlock >
@@ -2361,7 +2376,7 @@ It requires that a manufacturer specific get has been issued on the node.</Descr
23612376 <Group >Z-Wave</Group >
23622377 <Features />
23632378 <ActivationTime xsi : nil =" true" />
2364- <TriggerTime >2015-11-29T17:52:29.400148Z </TriggerTime >
2379+ <TriggerTime >2015-12-04T11:41:37.671966Z </TriggerTime >
23652380 <Type >CSharp</Type >
23662381 <IsEnabled >true</IsEnabled >
23672382 </ProgramBlock >
@@ -2608,7 +2623,7 @@ while (Program.IsEnabled)
26082623 </ProgramFeature >
26092624 </Features >
26102625 <ActivationTime xsi : nil =" true" />
2611- <TriggerTime >2015-11-29T17:52:29.599789Z </TriggerTime >
2626+ <TriggerTime >2015-12-04T11:41:37.676424Z </TriggerTime >
26122627 <Type >CSharp</Type >
26132628 <IsEnabled >true</IsEnabled >
26142629 </ProgramBlock >
@@ -2692,25 +2707,26 @@ Program.Run();</ScriptCondition>
26922707Func< string, string, bool> bridgeapicall = (string lightnumber, string parameter) =>
26932708{
26942709 var moduleRaise = Modules.InDomain("HomeAutomation.FibaroRGBW").WithAddress(lightnumber).Get();
2710+ var parentModule = Modules.InDomain("HomeAutomation.ZWave").WithAddress(lightnumber).Get();
26952711 string[] values = parameter.Split(',');
26962712
26972713 double level = (double.Parse(values[0].Replace(",", "."), CultureInfo.InvariantCulture)/255D)*99D ;
26982714 int iRed = (int)Math.Truncate(level) ;
2699- var moduleRed = Modules.InDomain("HomeAutomation.ZWave ").WithAddress(lightnumber+".2").Get( );
2700- moduleRed.Command("Control.Level").Set( ((int)iRed).ToString() ) ;
2715+ parentModule.Command("MultiInstance.Set ").Set("Switch.MultiLevel/2/" + ((int)iRed).ToString() );
2716+
27012717 level = (double.Parse(values[1].Replace(",", "."), CultureInfo.InvariantCulture)/255D)*99D ;
27022718 int iGreen = (int)Math.Truncate(level) ;
2703- var moduleGreen = Modules.InDomain("HomeAutomation.ZWave ").WithAddress(lightnumber+".3").Get( );
2704- moduleGreen.Command("Control.Level").Set( ((int)iGreen).ToString() ) ;
2719+ parentModule.Command("MultiInstance.Set ").Set("Switch.MultiLevel/3/" + ((int)iGreen).ToString() );
2720+
27052721 level = (double.Parse(values[2].Replace(",", "."), CultureInfo.InvariantCulture)/255D)*99D ;
27062722 int iBlue = (int)Math.Truncate(level) ;
2707- var moduleBlue = Modules.InDomain("HomeAutomation.ZWave").WithAddress(lightnumber+".4").Get();
2708- moduleBlue.Command("Control.Level").Set( ((int)iBlue).ToString() ) ;
2723+ parentModule.Command("MultiInstance.Set").Set("Switch.MultiLevel/4/" + ((int)iBlue).ToString());
27092724
27102725 Program.RaiseEvent(moduleRaise, "Status.ColorRgb", parameter, "Fibaro RGBW");
27112726
2712- double average = (iRed + iGreen + iBlue) / 3;
2713- Program.RaiseEvent(moduleRaise, "Status.Level", (average / 100).ToString(), "Fibaro RGBW");
2727+ // double average = (iRed + iGreen + iBlue) / 3;
2728+ // Program.RaiseEvent(moduleRaise, "Status.Level", (average / 100).ToString(), "Fibaro RGBW");
2729+ Program.RaiseEvent(moduleRaise, "Status.Level", "1", "Fibaro RGBW");
27142730
27152731 return true;
27162732};
@@ -2792,16 +2808,17 @@ When.WebServiceCallReceived("HomeAutomation.FibaroRGBW", ( args ) => {
27922808 //
27932809 switch(command)
27942810 {
2795- // eg. http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.On
2811+ // API : http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.On
27962812 case "Control.On":
27972813 module.On();
27982814 Program.RaiseEvent(moduleRaise, "Status.Level", "1", "Fibaro RGBW");
27992815 break;
2800- // eg. http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.Off
2816+ // API : http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.Off
28012817 case "Control.Off":
28022818 module.Off();
28032819 Program.RaiseEvent(moduleRaise, "Status.Level", "0", "Fibaro RGBW");
28042820 break;
2821+ // API : http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.Off
28052822 case "Control.Toggle":
28062823 if (module.Parameter("Status.Level").DecimalValue == 0)
28072824 {
@@ -2814,10 +2831,12 @@ When.WebServiceCallReceived("HomeAutomation.FibaroRGBW", ( args ) => {
28142831 Program.RaiseEvent(moduleRaise, "Status.Level", "0", "Fibaro RGBW");
28152832 }
28162833 break;
2834+ // API : http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.Level/< level> 0.00 to 1.00
28172835 case "Control.Level":
28182836 module.Command("Control.Level").Set((double.Parse(parameter.Replace(",", "."), CultureInfo.InvariantCulture)).ToString()) ;
28192837 Program.RaiseEvent(moduleRaise, "Status.Level", (double.Parse(parameter.Replace(",", "."), CultureInfo.InvariantCulture) / 100D).ToString(), "Fibaro RGBW");
28202838 break;
2839+ // API : http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.ColorHsb/< hue> ,< sat> ,< bri>
28212840 case "Control.ColorHsb":
28222841 Program.RaiseEvent(moduleRaise, "Status.ColorHsb", parameter, "Fibaro RGBW");
28232842 string[] hsbValues = parameter.Split(',');
@@ -2829,14 +2848,14 @@ When.WebServiceCallReceived("HomeAutomation.FibaroRGBW", ( args ) => {
28292848 // then you have rgbColor.Red, rgbColor.Green and rgbColor.Blue properties.
28302849 bridgeapicall(lightnumber, String.Format("{0},{1},{2}", rgbColor.Red, rgbColor.Green, rgbColor.Blue));
28312850 break;
2832- // eg. http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.ColorHsb /< hue > ,< sat > ,< bri >
2851+ // API : http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.ColorRgb /< red > ,< green > ,< blue >
28332852 case "Control.ColorRgb":
28342853 bridgeapicall(lightnumber, parameter);
28352854 break;
2855+ // API : http://< hg_address> /api/HomeAutomation.fibarorgbw/< light_number> /Control.ProgramRGB/< nprog> 6 to 10
28362856 case "Control.ProgramRGB" :
28372857 module.Command("Config.ParameterSet").Set("72/" + parameter);
28382858 Program.RaiseEvent(moduleRaise, "Status.Level", "1", "Fibaro RGBW");
2839- // Program.Notify("Program RGB", "N� " + parameter + " running" );
28402859 break;
28412860 }
28422861 //
@@ -6852,7 +6871,7 @@ while (Program.IsEnabled)
68526871 </ProgramFeature >
68536872 </Features >
68546873 <ActivationTime xsi : nil =" true" />
6855- <TriggerTime >2015-11-29T17:52:29.811091Z </TriggerTime >
6874+ <TriggerTime >2015-12-04T11:41:37.892342Z </TriggerTime >
68566875 <Type >CSharp</Type >
68576876 <IsEnabled >true</IsEnabled >
68586877 </ProgramBlock >
@@ -7565,7 +7584,7 @@ Also it lets you dim last addressed module using Up/Down button which can be def
75657584 </ProgramFeature >
75667585 </Features >
75677586 <ActivationTime xsi : nil =" true" />
7568- <TriggerTime >2015-11-29T17:52:29.792623Z </TriggerTime >
7587+ <TriggerTime >2015-12-04T11:41:38.064393Z </TriggerTime >
75697588 <Type >CSharp</Type >
75707589 <IsEnabled >true</IsEnabled >
75717590 </ProgramBlock >
0 commit comments