Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Has anybody done anything with Sensibo Sky?

If you have a question or need help, this is the place to be.
Post Reply
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Has anybody done anything with Sensibo Sky?

Post by kgschlosser »

I wonder something

Code: Select all



import requests
import json

# change this value.  If this errors, try 2.
setTemp = '20'

params = {}
params['apiKey'] = eg.globals.sensiboKey

# command paths
baseUrl = 'https://home.sensibo.com/api/v2'
devices = '/users/me/pods'
measurement = '/pods/' + eg.globals.sensiboDeviceId1 + '/measurements'
state = '/pods/' + eg.globals.sensiboDeviceId1 + '/acState'
setTemperature = '/pods/' + eg.globals.sensiboDeviceId1 + '/acState/targetTemperature'
setOnOff = '/pods/' + eg.globals.sensiboDeviceId1 + '/acState/on'
setMode = '/pods/' + eg.globals.sensiboDeviceId1 + '/acState/mode'
setFan = '/pods/' + eg.globals.sensiboDeviceId1 + '/acState/fanLevel'


setData = json.dumps({'currentAcState': eg.globals.sensiboLastState, 'newValue': setTemp})

response = requests.post(baseUrl + setTemperature, params = params, data=setData)
jString = response.content

print jString

deviceDict = json.loads(jString)
print json.dumps(deviceDict, indent=4)
If you like the work I have been doing then feel free to Image
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: Has anybody done anything with Sensibo Sky?

Post by Mastiff »

Here's your answer:

Code: Select all

09:18:29      <!DOCTYPE html>
09:18:29      <html lang="en">
09:18:29      <head>
09:18:29          <meta charset="utf-8">
09:18:29          <title></title>
09:18:29          <meta name="viewport" content="width=device-width, initial-scale=1.0">
09:18:29          <meta name="description" content="">
09:18:29          <meta name="author" content="">
09:18:29      
09:18:29          
09:18:29              <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
09:18:29          
09:18:29      
09:18:29          <style>
09:18:29              body {
09:18:29                  padding-top: 40px;
09:18:29                  padding-bottom: 40px;
09:18:29                  background-color: #f5f5f5;
09:18:29              }
09:18:29              .block-center {
09:18:29                  max-width: 500px;
09:18:29                  padding: 19px 29px 29px;
09:18:29                  margin: 0 auto 20px;
09:18:29                  background-color: #fff;
09:18:29                  border: 1px solid #e5e5e5;
09:18:29                  -webkit-border-radius: 5px;
09:18:29                  -moz-border-radius: 5px;
09:18:29                  border-radius: 5px;
09:18:29                  -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
09:18:29                  -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
09:18:29                  box-shadow: 0 1px 2px rgba(0,0,0,.05);
09:18:29              }
09:18:29              .block-center .block-center-heading {
09:18:29                  margin-bottom: 10px;
09:18:29              }
09:18:29      
09:18:29          </style>
09:18:29      </head>
09:18:29      
09:18:29      <body>
09:18:29      
09:18:29      <div class="container">
09:18:29          
09:18:29          <h1>Not Found</h1>
09:18:29          <p>The requested URL /api/v2/pods/oohZomrQ/acState/targetTemperature was not found on this server.</p>
09:18:29      
09:18:29      </div>
09:18:29      
09:18:29      </body>
09:18:29      </html>
09:18:29      
09:18:29      
09:18:29      
09:18:29      
09:18:29      Traceback (most recent call last):
09:18:29        Python script "289", line 28, in <module>
09:18:29          deviceDict = json.loads(jString)
09:18:29        File "json\__init__.pyc", line 339, in loads
09:18:29        File "json\decoder.pyc", line 364, in decode
09:18:29        File "json\decoder.pyc", line 382, in raw_decode
09:18:29      ValueError: No JSON object could be decoded
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Has anybody done anything with Sensibo Sky?

Post by kgschlosser »

ok moving forward..

Code: Select all

import requests

params = dict(
    apiKey=eg.globals.sensiboKey
)

baseUrl = 'https://home.sensibo.com/api/v2'
devices = '/users/me/pods'

response = requests.get(baseUrl + devices, params=params)
j_data = response.json()
pod_uids = [x['id'] for x in j_data['result']]
print pod_uids
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Has anybody done anything with Sensibo Sky?

Post by kgschlosser »

I wanted to mention the last printout that came up was because you cannot change the settings the way the script was going about it.

I need to know the pod ID of the unit to be able to move forward. once I have that it should be pretty simple.

Now this is where it may get complicated. I know you are using EG to control an MDU (multiple dwelling unit) I do not know enough about the sensibo sky but is one in each of the dwellings?
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Has anybody done anything with Sensibo Sky?

Post by kgschlosser »

This is going to print out a bunch of information. I do not know the sensitivity of the information contained in it. So send the output from it in a PM to me.

Code: Select all


import requests
import json

params = dict(
    apiKey=eg.globals.sensiboKey
)

baseUrl = 'https://home.sensibo.com/api/v2'
devices = '/users/me/pods'

response = requests.get(baseUrl + devices, params=params)
j_data = response.json()

print json.dumps(j_data, indent=4)
If you like the work I have been doing then feel free to Image
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: Has anybody done anything with Sensibo Sky?

Post by Mastiff »

Actually I only have one in the house. We own a house with a larger, two and a half story appartment on top where we rent out to students from mid August to mid June and tourists in the summer. And then we live in a smaller appartment in the bottom floor. But the info wasn't any sensitive, and it wasn't much either:

Code: Select all

09:43:07      {
09:43:07          "status": "success", 
09:43:07          "result": [
09:43:07              {
09:43:07                  "id": "oohZomrQ"
09:43:07              }
09:43:07          ]
09:43:07      }
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Has anybody done anything with Sensibo Sky?

Post by kgschlosser »

ok sweet.

next step

Code: Select all

import requests
import json

params = dict(
    apiKey=eg.globals.sensiboKey
)

response = requests.get(baseUrl + '/pods/oohZomrQ/acStates', params=params)
j_data = response.json()
print json.dumps(j_data, indent=4)
FYI I am writing a plugin as we do this.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Has anybody done anything with Sensibo Sky?

Post by kgschlosser »

also run this as well

Code: Select all

import requests
import json

params = dict(
    apiKey=eg.globals.sensiboKey
)

response = requests.get(baseUrl, params=params)

print response.content
j_data = response.json()
print json.dumps(j_data, indent=4)
If you like the work I have been doing then feel free to Image
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: Has anybody done anything with Sensibo Sky?

Post by Mastiff »

Oh, I hope I haven't started a plug-in war between you two here! :o

First code:

Code: Select all

11:22:46      Traceback (most recent call last):
11:22:46        Python script "302", line 8, in <module>
11:22:46          response = requests.get(baseUrl + '/pods/oohZomrQ/acStates', params=params)
11:22:46      NameError: name 'baseUrl' is not defined
Second code:

Code: Select all

11:24:28      Traceback (most recent call last):
11:24:28        Python script "303", line 8, in <module>
11:24:28          response = requests.get(baseUrl, params=params)
11:24:28      NameError: name 'baseUrl' is not defined
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Has anybody done anything with Sensibo Sky?

Post by kgschlosser »

first one

Code: Select all

import requests
import json

baseUrl = 'https://home.sensibo.com/api/v2'
params = dict(
    apiKey=eg.globals.sensiboKey
)

response = requests.get(baseUrl + '/pods/oohZomrQ/acStates', params=params)
j_data = response.json()
print json.dumps(j_data, indent=4)

second one

Code: Select all

import requests
import json
baseUrl = 'https://home.sensibo.com/api/v2'
params = dict(
    apiKey=eg.globals.sensiboKey
)

response = requests.get(baseUrl, params=params)

print response.content
j_data = response.json()
print json.dumps(j_data, indent=4)
If you like the work I have been doing then feel free to Image
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: Has anybody done anything with Sensibo Sky?

Post by Mastiff »

I believe you have something now! :mrgreen: Going to PM, there were several IDs there that I don't know if anybody can use against me.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Has anybody done anything with Sensibo Sky?

Post by kgschlosser »

ok that is a history of all of the changes you have made to the unit.

I am going to go to bed it's 4:12 AM here. I only have to make the actions for the plugin


Plugin actions

Temperature Setpoint
Fan speed
Power
Swing (motorized vent i am assuming)
Temperature Unit
Mode
Humidity
Temperature

Plugin Events:

Temperature Setpoint
Fan speed
Power
Swing (motorized vent i am assuming)
Temperature Unit
Mode
Humidity
Temperature
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Has anybody done anything with Sensibo Sky?

Post by kgschlosser »

It is also going to be multiple unit capable.
If you like the work I have been doing then feel free to Image
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: Has anybody done anything with Sensibo Sky?

Post by Mastiff »

Great, thanks! :mrgreen: Btw I didn't even know the humidity was something you can set, like an action. It must be connected to mode (dry, auto, heat, fan, cool). But I'm looking forward to seing the results!

Edit: The swing is up and down, and vents inside going sideways. Like a car AC vent, only motorized.
User avatar
yokel22
Experienced User
Posts: 265
Joined: Thu Feb 05, 2015 5:56 pm
Location: U.S. - Kansas city

Re: Has anybody done anything with Sensibo Sky?

Post by yokel22 »

Kg, you read anything I posted? You just made ten post with the same info. I've never used patch before, that's the way the sample client was written. Looking at the request doc, it's essentially the same as post & put.

The error is due to bad request, which I already knew. It has to do with how their formatting & sending the data for the patch request. Take a look at the sample code. Maybe you can spot something I missed.
Post Reply