Created
February 5, 2018 02:19
-
-
Save ProxiBlue/f7a751c9634a175bde1d6725abd7ce6c to your computer and use it in GitHub Desktop.
Sensibo AC Climate React Scheduling via API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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 BadRequestPOST data is not valid JSON
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 ~ $
@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)
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
Yes it is individually controlled.