je viens enfin de trouver la réponse ici : https://forum.fibaro.com/topic/51248-communication-between-hc2-and-hc3/
Code Button 1, to switch Fibaro Double switch On:
httpRequest = Net.FHttp('192.168.178.1', 80);
httpRequest:setBasicAuthentication('admin', 'admin');
httpRequest:GET("/api/callAction?deviceID=84&name=turnOn");
fibaro:debug('done');
Code switch 2, to switch Fibaro Double switch Off:
httpRequest = Net.FHttp('192.168.178.1', 80);
httpRequest:setBasicAuthentication('admin', 'admin');
httpRequest:GET("/api/callAction?deviceID=84&name=turnOff");
fibaro:debug('done');
Button 3,
First create a Global Varaible on the HC2 and on the HC3 with the name: MyGlobalValue
in this example I use Authentication (user;password) admin;admin
In the push button of the HC2 VD you program:
local MyGlobalValue = fibaro:getGlobalValue("MyGlobalValue");
jsonTable = {value = MyGlobalValue };
jsonString = json.encode(jsonTable);
httpRequest = Net.FHttp('192.168.178.1', 80);
httpRequest:setBasicAuthentication('admin', 'admin');
response, status, errorcode = httpRequest:PUT("/api/globalVariables/MyGlobalValue", jsonString);
fibaro:debug(response);
fibaro:debug(status);
fibaro:debug(errorcode);
fibaro:debug('Done');
By pressing button 1, 2 or 3 of your new VD, your double switch must be switched on or off, or the value of MyGlobalValue must be taken from your HC2 in the HC3.