Since last spring I have been using the
Sensibo SKY (similar to AmbiClimate) to control my air conditioner. It has its own API, to which
@Alchy (thank you so much!) developed a Homematic script to control air conditionion split directly from CCU (over CUxD).
With the script I made several CCU programs to automate AC split control in various situations.
Now the air conditioning is controlled by:
- voice control (Google Asistant or Amazon Alexa)
- from all smartphone's (even remotely) or home automation tablet
- and of course from the Homematic environment (leaving the house, comming home, opening a window/door in room with AC split, etc.)
Everything is synchronized.
We no longer use the hand-held original remote control, it is not needed, stored as a backup in a drawer
_________________________________________________________________________________________
Script for On/Off Air Condition with Sensibo SKY gadget, and wrote the Status to boolean Sysvar.
_________________________________________________________________________________________
At line 3 write your
APIKEY (
https://home.sensibo.com/me/api)
At line 4 write your
PODS (Device ID).
PODS is your
UID, you can see the device
UID when you go to the WEB app (web browser, no App!) and choose in "3dot menu"
More ->
Advanced ->
Advanced info
At line 5, define you name of boolean Systemvariable, in my case "
VAR_AC_Status" for status of your Air Condition.
Logic value, in my case true = ON, false = OFF.
At line 9, is string "
on" for turn ON Air Condition, change to "
off" in the case of calling a script to turn OFF the Air Conditioner...
Code: Alles auswählen
!script On/Off Air Condition over Sensibo and wrote the Status to boolean Sysvar
!v0.2 (c) by alchy
string APIKEY = "..............................";
string PODS = "..........";
string SV_ACState = "VAR_AC_Status"; !Name of boolean Systemvariable
! ++++++++++++ do not touch +++++++++++
boolean bACState = false;
var URL = "https://home.sensibo.com/api/v2/pods/"#PODS#"/acStates?apiKey='"#APIKEY#"'";
string CMD = " -d '{\"acState\":{\"on\":true}}'";
WriteLine(URL#CMD);
dom.GetObject("CUxD.CUX2801001:1.CMD_SETS").State("/usr/local/addons/cuxd/curl -X POST '"#URL#"'" #CMD#"");
dom.GetObject("CUxD.CUX2801001:1.CMD_QUERY_RET").State(1);
string srueck = dom.GetObject("CUxD.CUX2801001:1.CMD_RETS").State();
if(srueck == ""){ WriteLine("Request failure");}else{
srueck = srueck.Replace("\{", "").Replace("{", "").Replace("\"", "").Replace("}", "");
string part; foreach (part, srueck.Split(",")){
if(part.StartsWith(" acState: on:")){bACState = part.StrValueByIndex(":",2);}
}
if( dom.GetObject(ID_SYSTEM_VARIABLES).Get(SV_ACState)) { dom.GetObject(ID_SYSTEM_VARIABLES).Get(SV_ACState).State(bACState); WriteLine( "Sysvar: "#SV_ACState #" switched to: "#bACState);
}else{WriteLine("Sysvar: "#SV_ACState #" not there, please add at CCU");}
}