Sensibo SKY and PURE Integration into Homematic

Support for our english speaking visitors

Moderator: Co-Administratoren

omicronCZ
Beiträge: 153
Registriert: 31.07.2011, 17:37
Wohnort: Czech Rep.
Hat sich bedankt: 47 Mal
Danksagung erhalten: 5 Mal

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von omicronCZ » 22.06.2021, 11:21

New version of the script for Sensibo SKY read status and wrote the Status to several Systemvariables.
For Sensibo PURE (Air Purifier) is a little different script.

Code: Alles auswählen

!..Skript SENSIBO SKY several Device - Read status and wrote the Status to several Systemvariables 
! v0.6 (c) by Alchy, modified by Omicron 6-2021
string APIKEY = "....................................";
string PODS = "............=Kitchen"; !DeviceID=DeviceName -> comma separated
string prefix = "VAR_AC_";
!++++++++ dont touch ++++++++++
string sDevPod; foreach (sDevPod, PODS.Split(",")){
string sDev = sDevPod.StrValueByIndex("=",1);
string sPod = sDevPod.StrValueByIndex("=",0);
var URL = "https://home.sensibo.com/api/v2/pods/"#sPod#"/acStates?fields=acState&apiKey='"#APIKEY#"'";
string srueck;string serr;string part; string sName;string sValue;integer count = 0;
system.Exec("wget --no-check-certificate -q -O - '"#URL#"'" , &srueck, &serr);
if(srueck == ""){ WriteLine("Request failure");}else{
srueck = srueck.Replace("\{", "").Replace("{", "").Replace("\"", "").Replace("}", "").Replace("result: [acState: on", "Status").Replace(" ", ""); 
WriteLine("\r\n"#sDev#"\r\n"#srueck);
foreach (part, srueck.Split(","))
{
count = count +1;
sName = part.StrValueByIndex(":",0);
sValue = part.StrValueByIndex(":",1);
if( (count == 4) || (count == 5) || (count == 6) || (count == 8) || (count == 9) || (count == 10) || (count == 11) ){ 
if (dom.GetObject(ID_SYSTEM_VARIABLES).Get(prefix#sDev#"_"#sName)) { dom.GetObject(ID_SYSTEM_VARIABLES).Get(prefix#sDev#"_"#sName).State(sValue); WriteLine( count#" Sysvar: "#prefix#sDev#"_"#sName #" switched to: "#sValue); 
}else{WriteLine(count#" Sysvar: "#prefix#sDev#"_"#sName #" for  Value: "#sValue #"  -not there, please add at CCU");} 
}}
}}
}
Example of read values (these are fields 4,5,6,8,9,10,11 in the script body)
If my Sensibo SKY device (room) is named "Kitchen", it requires the following variables to be defined:

Code: Alles auswählen

VAR_AC_Kitchen_fanLevel
VAR_AC_Kitchen_horizontalSwing
VAR_AC_Kitchen_light
VAR_AC_Kitchen_mode
VAR_AC_Kitchen_on
VAR_AC_Kitchen_swing
VAR_AC_Kitchen_targetTemperature

daham@chello.at
Beiträge: 13
Registriert: 11.02.2021, 08:10
System: CCU

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von daham@chello.at » 23.06.2021, 19:35

Thank you for the explanation!
Is there a way to insert values ​​into the Sensibo? :roll:

omicronCZ
Beiträge: 153
Registriert: 31.07.2011, 17:37
Wohnort: Czech Rep.
Hat sich bedankt: 47 Mal
Danksagung erhalten: 5 Mal

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von omicronCZ » 24.06.2021, 11:57

Yes, I described it here viewtopic.php?f=49&t=49889#p563351 If you are interested in specific scripts. I can publish them here as well.

I have a solution for switching the air conditioning on or off, setting the air conditioning mode, fan control, display (e.g. at night), louvre etc.

This will automate the operation of the active AC split, e.g. when opening a window, leaving or coming out of the house, etc.

I then use this also outside the summer season, e.g. to automatically start the AC split in ventilation mode when the room is ventilated (in winter, etc.).

daham@chello.at
Beiträge: 13
Registriert: 11.02.2021, 08:10
System: CCU

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von daham@chello.at » 24.06.2021, 14:05

Yes of course, i will change in first the Temperatur.

Can you please publish the scripts?

omicronCZ
Beiträge: 153
Registriert: 31.07.2011, 17:37
Wohnort: Czech Rep.
Hat sich bedankt: 47 Mal
Danksagung erhalten: 5 Mal

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von omicronCZ » 26.06.2021, 16:55

Here are a couple of scripts I use.

Air Condition OFF

Code: Alles auswählen

string APIKEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
string PODS = "zzzzzzzzzzz";
! ++++++++++++ do not touch +++++++++++
var URL = "https://home.sensibo.com/api/v2/pods/"#PODS#"/acStates?apiKey='"#APIKEY#"'";
string CMD = " -d '{\"acState\":{\"on\":false}}'";
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{WriteLine(srueck#"\r\n");}
Air Condition FAN low

Code: Alles auswählen

string APIKEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
string PODS = "zzzzzzzzzzz";
! ++++++++++++ do not touch +++++++++++
var URL = "https://home.sensibo.com/api/v2/pods/"#PODS#"/acStates?apiKey='"#APIKEY#"'";
string CMD = " -d '{\"acState\":{\"fanLevel\":\"Low\"}}'";
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{WriteLine(srueck#"\r\n");}
Air Condition FAN low

Code: Alles auswählen

string APIKEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
string PODS = "zzzzzzzzzzz";
! ++++++++++++ do not touch +++++++++++
var URL = "https://home.sensibo.com/api/v2/pods/"#PODS#"/acStates?apiKey='"#APIKEY#"'";
string CMD = " -d '{\"acState\":{\"mode\":\"Heat\"}}'";
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{WriteLine(srueck#"\r\n");}
Other commands can be derived from the so-called "remoteCapabilities" :

Code: Alles auswählen

"Mode"
dry
auto
heat
fan
cool

"fanLevel"
low
medium
high
auto
strong

"horizontalSwing"
stopped (auto)
fixedLeft
fixedCenterLeft
fixedCenter
fixedCenterRight
fixedRight
fixedLeftRight
rangeFull (moving)
rangeCenter (moving center)

"swing"
stopped (auto)
fixedTop
fixedMiddleTop
fixedMiddle
fixedMiddleBottom
fixedBottom
rangeTop (moving)
rangeMiddle (moving)
rangeBottom (moving)
rangeFull (moving)
"remoteCapabilities", describe the individual states that are used in the script in the line that describes the specific command for the SKY module, Here's an example of turning on the air conditioning:

Code: Alles auswählen

string CMD = " -d '{\"acState\":{\"on\":true}}'";

daham@chello.at
Beiträge: 13
Registriert: 11.02.2021, 08:10
System: CCU

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von daham@chello.at » 26.06.2021, 18:07

Hi omicronCZ your Scripts are super, Thank You!
how can the script for
Mode: cool, targetTemperature: 22
be?

daham@chello.at
Beiträge: 13
Registriert: 11.02.2021, 08:10
System: CCU

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von daham@chello.at » 26.06.2021, 19:35

daham@chello.at hat geschrieben:
26.06.2021, 18:07
Hi omicronCZ your Scripts are super, Thank You!
how can the script for
Mode: cool, targetTemperature: 22
be?
I am sooooo happy, here is the Script for 22 Degrees

string APIKEY = "yyyyyyyyyyyyyyyyyyyyyyyy";
string PODS = "zzzzzzzzzzzz";
! ++++++++++++ do not touch +++++++++++
var URL = "https://home.sensibo.com/api/v2/pods/"# ... ='"#APIKEY#"'";
string CMD = " -d '{\"acState\":{\"targetTemperature\":22}}'";
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{WriteLine(srueck#"\r\n");}

omicronCZ
Beiträge: 153
Registriert: 31.07.2011, 17:37
Wohnort: Czech Rep.
Hat sich bedankt: 47 Mal
Danksagung erhalten: 5 Mal

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von omicronCZ » 27.06.2021, 15:43

I'm glad it's working for you :D
And I'm glad there is another happy user of Sensibo SKY and my integration into Homematic.

I had forgotten about the "remoteCapabilities" for the target temperature, but I don't usually change the temperature from Homematic system in my Sensibo integration.

I now use the Sensibo integration mainly for :
  • automatic suspension of active cooling when a window is opened in a room with AC
  • switching off the air conditioning in the whole house when the house is armed (when leaving)
  • and now also outside the summer season to support ventilation of the room when a window is opened to restore fresh air
In the future I would also like to integrate AC control into the room HM thermostats I have in each room that also has AC

Antworten

Zurück zu „HomeMatic - english“