-
-
Save ProxiBlue/f7a751c9634a175bde1d6725abd7ce6c to your computer and use it in GitHub Desktop.
#!/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 |
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)
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?
Yes it is individually controlled.
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).
How do you turn the climate react off??
STATE=$0 then ??