Sensibo SKY and PURE Integration into Homematic

Support for our english speaking visitors

Moderator: Co-Administratoren

omicronCZ
Beiträge: 206
Registriert: 31.07.2011, 17:37
System: CCU
Wohnort: Czech Rep.
Hat sich bedankt: 80 Mal
Danksagung erhalten: 12 Mal

Sensibo SKY and PURE Integration into Homematic

Beitrag von omicronCZ » 25.03.2019, 16:19

Did you someone try to integrate into Homematic the Sensibo gadget for smart home air conditioning control ?

Sensibo has an open API interface, that can be controlled from CCU2/3, and depending on events in Homematic, home air conditioning could be turned on and off.

Also, the status of the air conditioner could be loaded using scripts over the Sensibo API.

Me with their examples somehow fail ...
Zuletzt geändert von omicronCZ am 18.05.2021, 16:57, insgesamt 1-mal geändert.

omicronCZ
Beiträge: 206
Registriert: 31.07.2011, 17:37
System: CCU
Wohnort: Czech Rep.
Hat sich bedankt: 80 Mal
Danksagung erhalten: 12 Mal

Re: Homematic and Sensibo Air Condition Gadget

Beitrag von omicronCZ » 02.04.2019, 22:57

For example, the API specifies this syntax to enable - disable AC, can it be used in the Homematic script?
Will anyone knowledgeable with HM scripts help?
Is it possible to implement HM script?

Code: Alles auswählen

Turn on the AC
`curl -X POST https://home.sensibo.com/api/v2/pods/xxxxx/acStates?apiKey=yyyyy -d "{\"acState\":{\"on\":true}}"`

Code: Alles auswählen

Turn off the AC
`curl -X POST https://home.sensibo.com/api/v2/pods/xxxxx/acStates?apiKey=yyyyy -d "{\"acState\":{\"on\":false}}"`
xxxxx : identification of my device
yyyyy : my private API key

The Sensibo API is built on HTTP. Our API is RESTful. It accepts and returns JSON in the HTTP body. You can use your favorite HTTP/REST library for your programming language to use the API, or you can use one of our SDKs (currently available in [Python](https://github.com/Sensibo/sensibo-python-sdk)).

webdb
Beiträge: 13
Registriert: 05.11.2018, 06:59
Danksagung erhalten: 1 Mal

Re: Homematic and Sensibo Air Condition Gadget

Beitrag von webdb » 11.02.2020, 11:53

Hi
Do you have a solution for your problem in the meantime? I'm having the same problems but struggle to implement it

Thanks
Daniel

tomi_cc16
Beiträge: 1150
Registriert: 30.11.2013, 16:35
Wohnort: Mordor
Hat sich bedankt: 23 Mal
Danksagung erhalten: 56 Mal

Re: Homematic and Sensibo Air Condition Gadget

Beitrag von tomi_cc16 » 11.02.2020, 17:36

1.e.g. Install Redmatic Addon and than this https://flows.nodered.org/node/node-red-contrib-sensibo
https://github.com/rdmtc/RedMatic/wiki

2. Or Install CuxD Addon and create e.g. a Vurital remote and add in the programm than:
string url="YOUR_HTTP_REQUEST";
dom.GetObject("CUxD.CUX2801001:1.CMD_EXEC").State("wget -q -O /dev/null " # url);
Here from 08:20min you see the necessary steps in the video: https://www.youtube.com/watch?v=C9TFzM99YmI

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

FYI - CuxD can also be used for Wake-On-Lan:
string stderr;
string stdout;
string wake;
wake = "/usr/local/addons/cuxd/extra/ether-wake -Your MAC-Adress";
system.Exec(wake, &stdout, &stderr);

https://www.christian-luetgens.de/homem ... erwake.htm

omicronCZ
Beiträge: 206
Registriert: 31.07.2011, 17:37
System: CCU
Wohnort: Czech Rep.
Hat sich bedankt: 80 Mal
Danksagung erhalten: 12 Mal

AC control with Homematic and Sensibo SKY (Air Condition Gadget)

Beitrag von omicronCZ » 11.02.2020, 20:43

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 :D

_________________________________________________________________________________________
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");} 
}
Zuletzt geändert von omicronCZ am 25.04.2021, 17:34, insgesamt 1-mal geändert.

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

Re: Homematic and Sensibo Air Condition Gadget

Beitrag von daham@chello.at » 12.03.2021, 11:37

In welchem Format sollte den die PODS(UID) eingetragen werden?

sollen gewisse Ports auf der Firewall freigegeben werden?

Ich bekomme beim ausführen des Skripts immer diese Rückmeldung, egal ob true oder false am ende eingetragen ist.

https://home.sensibo.com/api/v2/pods/XX ... yyyyyyyyyy' -d '{"acState":{"on":false}}'
Sysvar: VAR_AC_Status switched to: false

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

Re: Homematic and Sensibo Air Condition Gadget

Beitrag von daham@chello.at » 22.03.2021, 16:43

daham@chello.at hat geschrieben:
12.03.2021, 11:37
In welchem Format sollte den die PODS(UID) eingetragen werden?

sollen gewisse Ports auf der Firewall freigegeben werden?

Ich bekomme beim ausführen des Skripts immer diese Rückmeldung, egal ob true oder false am ende eingetragen ist.

https://home.sensibo.com/api/v2/pods/XX ... yyyyyyyyyy' -d '{"acState":{"on":false}}'
Sysvar: VAR_AC_Status switched to: false
Sorry war mein Fehler hat die falsche API :x

omicronCZ
Beiträge: 206
Registriert: 31.07.2011, 17:37
System: CCU
Wohnort: Czech Rep.
Hat sich bedankt: 80 Mal
Danksagung erhalten: 12 Mal

Sensibo SKY and PURE - Skript for several Sensibo Devices - Read status and wrote the Status to several Systemvariables

Beitrag von omicronCZ » 25.04.2021, 18:11

Here is another script (created again with the help of @Alchy), which is used to determine the status of air conditioners, which are controlled with the help of the SENSIBO Sky module.

Sensibo company launched a smart air purifier PURE, which uses the same API as SKY air conditioning controllers. I already use this air purifier, and I needed to read its status as well.

Script configuration
APIKEY - create a Sensibo web interface for use in Homematic,
PODS - list of all Sensibo devices (SKY and PURE)
prefix - for Systemvariables into which the returned data will be loaded. I use "VAR_AC_", the script always adds the name of the value, and stores the data in this variable.

If you run a properly configured script in the script test window, it will always return the selected values loaded. If there is no variable created in the CCU, it will notify you in the test window.

For clarity, I left the names of my devices in the list of devices, but without their real IDs (DeviceID)

Code: Alles auswählen

!..Skript SENSIBO several Device - Read status and wrote the Status to several Systemvariables 
! v0.6 (c) by Alchy, modified by Omicron 3-2021
string APIKEY = "xyxyxyxyxyxyxyxyx";
string PODS = "aaaaaaaa=Kitchen,bbbbbbbb=Office,cccccccccc=KitchenPure"; !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 == 3) || (count == 4) || (count == 7) || (count == 8) || (count == 9) || (count == 10) || (count == 40) ){ 
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");} 
}}
}}
}

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

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von daham@chello.at » 21.06.2021, 22:04

what kind of type should i take for
VAR_AC_Klima_secondsAgo

i become allways this message: VAR_AC_Klima_secondsAgo for Value: 0 -not there, please add at CCU

please help
Zuletzt geändert von daham@chello.at am 21.06.2021, 23:35, insgesamt 1-mal geändert.

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

Re: Sensibo SKY and PURE Integration into Homematic

Beitrag von daham@chello.at » 21.06.2021, 23:38

könnte mir jemand den Befehl für z.b.
20 Grad, modus kühlen, fan level 2, swing rangefull
erstellen?

Ich schaff das irgendwie nicht. :roll: :cry:

Antworten

Zurück zu „HomeMatic - english“