Skip to content

Instantly share code, notes, and snippets.

@ProxiBlue
Created February 5, 2018 02:19
Show Gist options
  • Save ProxiBlue/f7a751c9634a175bde1d6725abd7ce6c to your computer and use it in GitHub Desktop.
Save ProxiBlue/f7a751c9634a175bde1d6725abd7ce6c to your computer and use it in GitHub Desktop.
Sensibo AC Climate React Scheduling via API
#!/bin/bash
STATE=$1
echo $STATE
curl -X PUT -H "Content-Type: application/json" -d '{"enabled":'${STATE}'}' https://home.sensibo.com/api/v2/pods/DEVICE_ID/smartmode/?apiKey=API KEY
@kimnguan
Copy link

How do you turn the climate react off??
STATE=$0 then ??

@ProxiBlue
Copy link
Author

ProxiBlue commented May 28, 2020

Hi, no.

$1 = First passed bash variable.

Ref: https://www.proxiblue.com.au/blog/ifttt-sensibo-climate-react-schedule/

So, you will call this script with a param: of true = on, and false = off

example:

~/sensibo_climate_schedule.sh true (for on)
~/sensibo_climate_schedule.sh false (for off)

@hrishter
Copy link

hrishter commented Jun 29, 2020

Hey! Is there a way to customise this for individual units? For example, at night, having a bedroom unit on for climate react, while having the living room unit off?

@kimnguan
Copy link

Yes it is individually controlled.

@sfspot2020
Copy link

Does the script still work? I bump into your blog post and tried to run it through my Linux server, keep getting

<title>400 BadRequest - Sensibo</title>400 BadRequest

POST data is not valid JSON

@ProxiBlue
Copy link
Author

ProxiBlue commented Mar 18, 2022

Yep, just did a quick test. It does seem they changed the input variable from Integer to BOOL.

[Sat Mar 19 05:29:41] lucas@multivac ~ $ bash ./sensibo_test.sh true
true
{"status": "success", "result": {"enabled": true, "type": "feelsLike", "deviceUid": "REMOVED", "lowTemperatureThreshold": 27.0, "highTemperatureThreshold": 33.0, "lowTemperatureState": {"on": false, "targetTemperature": 22, "temperatureUnit": "C", "mode": "cool", "fanLevel": "low"}, "highTemperatureState": {"on": true, "targetTemperature": 23, "temperatureUnit": "C", "mode": "cool", "fanLevel": "medium", "swing": "stopped", "horizontalSwing": "stopped"}, "lowTemperatureWebhook": null, "highTemperatureWebhook": null}}[Sat Mar 19 05:29:45] lucas@multivac ~ $ bash ./sensibo_test.sh false
false
{"status": "success", "result": {"enabled": false, "type": "feelsLike", "deviceUid": "REMOVED", "lowTemperatureThreshold": 27.0, "highTemperatureThreshold": 33.0, "lowTemperatureState": {"on": false, "targetTemperature": 22, "temperatureUnit": "C", "mode": "cool", "fanLevel": "low"}, "highTemperatureState": {"on": true, "targetTemperature": 23, "temperatureUnit": "C", "mode": "cool", "fanLevel": "medium", "swing": "stopped", "horizontalSwing": "stopped"}, "lowTemperatureWebhook": null, "highTemperatureWebhook": null}}[Sat Mar 19 05:29:49] lucas@multivac ~ $

@ProxiBlue
Copy link
Author

@hrishter (sorry, never seen your comment from back then), so just for others: yes, the script uses a device ID so can control any unit.
You can easy adjust the script to accept additional params, and pass a device ID to control

#!/bin/bash 
STATE=$1
DEVICE=$2
echo $STATE $DEVICE
curl -X PUT -H "Content-Type: application/json" -d '{"enabled":'${STATE}'}' https://home.sensibo.com/api/v2/pods/${DEVICE}/smartmode/?apiKey=API KEY

then use params : ~/sensibo_climate_schedule.sh true XXXXXXXXX (state + device UUID)

@sfspot2020
Copy link

Thank you for your reply, I totally missed the parameter part at the end (true or false).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment