quote=ârlkoshak, post:2, topic:150353â]
The unicorn case isnât going to happen without rules. But using a String Item that triggers a rule, you can implement all of the rest in the rule no problem using the sendHttpPutRequest Action.
[/quote]
Wow, nice idea! So itâs just one general rule and this is triggered by the string Item being updated⊠theoretically even another item for a return value, if any required, would be possible.
Itâll take some time, but as soon as I have something like this working, Iâll share it at this place!
UPDATE
Weeeell⊠that went way better than expected. I just wanted to gite it a quick try. Itâs working.
val HomePilotIP = "192.168.1.5";
val timeout = 3000;
var sceneName = HomePilot_Scene_Trigger.state.toString;
var searchString = "$.scenes[?(@.name==\"" + sceneName + "\")].sid";
var JsonSceneMap = sendHttpGetRequest("http://" + HomePilotIP + "/v4/scenes", timeout);
var SID = transform("JSONPATH", searchString, JsonSceneMap);
var url = "http://" + HomePilotIP + "/scenes/" + SID + "/actions";
var cmd = "{\"request_type\":\"EXECUTESCENE\", \"trigger_event\":\"TRIGGER_SCENE_MANUALLY_EVT\"}"
var result = sendHttpPostRequest(url, "application/json", cmd, timeout);
With this in a rule which triggers on any update on HomePilot_Scene_Trigger
, a String item, it actually triggers the scene by its written clear name in the HomePilot. Very, very cool. Thanks a lot!!!