Sensibo Climate React

Sensibo Sky supports a feature called Climate React which enables users to set up, amongst other things, a temperature range for the device to maintain by switching the AC on and off. The Climate React feature itself can be enabled and disabled via the app.

It would be great if support for enabling and disabling Climate React were added to pysensibo and Home Assistant. This would open up some doors for automation. For example, Climate React should be enabled in the toddler’s room whilst he/she is sleeping there and hence the AC should maintain the desired temperature range in the room whilst the toddler is there, however if the toddler is not sleeping in the room, Climate React should be disabled so that the AC is not turned on/off unnecessarily to maintain the temperature in an empty room. Support for editing the Climate React parameters need not be added as one can use the app for that, but automating the enabling and disabling of that feature, with the parameters already have been previously defined, would be very useful.

The API endpoint for enabling / disabling this is here:
https://sensibo.github.io/#/paths/~1pods~1{device_id}~1smartmode/put

Further, to get the status of the Climate React feature, an additional field to fetch called smartMode can be added to the existing _FETCH_FIELDS array in the current implementation and the enabled property on that object can be inspected to determine whether it is enabled or not.

On second thought, it seems that calling the API endpoint for enabling / disabling Climate React clears the Climate React settings. I picked up this behavior when using Postman for testing. This was not the behavior I was after and it differs from what the Sensibo app does. More research is needed, it seems.

Ok I got more time to test this and the Climate React aka “smartmode” API DOES actually work. I got the HTTP verb wrong originally and used POST instead of PUT. Using POST caused the Climate React settings to be cleared, but using PUT had the desired effect where I could enable and disable it.

So my request still stands. Is there any chance that this could be added to pysensibo and Home Assistant (just the enabling and disabling of Climate React)? I can give it a shot myself, but I am a total newbie at writing Home Assistant python code.

1 Like

Has there been any update or movement on this? Sensibo ‘Climate React’ or smartmode is also something I’m looking to schedule via HA based on time and this endpoint isn’t available.

I’m relatively new to HA but have scripting experience - is creating an API webhook manually via HA scripts an option to hit the Sensibo Climate React endpoint?

EDIT: Probably a more elegant way of doing this but I’ve found https://www.home-assistant.io/integrations/rest_command/ and been able to get this working by adding

rest_command: !include rest.yaml

to the configuration.yaml file and then creating rest.yaml and adding the below to it:

    sensibo_climate_react:
    url: !secret sensibo_set_climate_react_secret_url
    method: put
    payload: '{"enabled": {{ enabled }} }'

This is what I added to my secrets.yaml file

sensibo_set_climate_react_secret_url: 'https://home.sensibo.com/api/v2/pods/{{ deviceid }}/smartmode/?apiKey=YOUR-API-KEY

To call this in an automation I use:

service: rest_command.sensibo_climate_react
data:
  deviceid: YOUR DEVICE ID 
  enabled: 'true' # or 'false'
NOTE: you can get your device id’s from a GET request to https://home.sensibo.com/api/v2/users/me/pods?fields=*&apiKey=<>

Hi @smck83,

Thank you for posting this. I ended up doing something similar to what you did, except I use a REST switch instead of a command. At the time I couldn’t find a way to parameterise the the deviceid in the URL, so I have the entire URL with the deviceid and API key as one secret.

Here is mine:

switch:
  - platform: rest
    name: Baby Room AC Climate React
    resource: !secret sensibo_baby_room
    method: put
    is_on_template: '{{ value_json.result.enabled }}'
    body_on: '{ "enabled": true }'
    body_off: '{ "enabled": false }'

Using the above, I can display a switch in the UI right next to the climate control. The switch also detects whether climate react is on, so it will display the correct state even if you change the state in the app.

Thanks again @ivanl - now that I’m at 4 x sensibo I’ve changed mine to work more like yours - via a switch which is easy to see on my FireHD 10 wallmounted tablet. I decided to go with a template switch which lets me pass the deviceID. Sharing for anyone else interested:

Below is in secrets.yaml

sensibo_get_devices: "https://home.sensibo.com/api/v2/users/me/pods?fields=*&apiKey=<---YOUR_API_KEY--->"
sensibo_set_climate_react_secret_url: "https://home.sensibo.com/api/v2/pods/{{ deviceid }}/smartmode/?apiKey=<---YOUR_API_KEY--->"

Below is in my configuration.yaml or in the respective rest.yaml and switch.yaml files

rest:
  resource: !secret sensibo_get_devices
  method: GET
  scan_interval: 60 
  verify_ssl: true
  sensor:
    - name: "Sensibo - Baby Room"
      json_attributes_path: "$.result[0].smartMode"
      value_template: "OK"
      json_attributes:
        - enabled
        - deviceUid
        - lowTemperatureThreshold
        - highTemperatureThreshold
    - name: "Sensibo - Living Room"
      json_attributes_path: "$.result[1].smartMode"
      value_template: "OK"
      json_attributes:
        - enabled
        - deviceUid
        - lowTemperatureThreshold
        - highTemperatureThreshold
    - name: "Sensibo - Bedroom"
      json_attributes_path: "$.result[2].smartMode"
      value_template: "OK"
      json_attributes:
        - enabled
        - deviceUid
        - lowTemperatureThreshold
        - highTemperatureThreshold
    - name: "Sensibo - Office"
      json_attributes_path: "$.result[3].smartMode"
      value_template: "OK"
      json_attributes:
        - enabled
        - deviceUid
        - lowTemperatureThreshold
        - highTemperatureThreshold
        



rest_command:
  sensibo_climate_react:
    url: !secret sensibo_set_climate_react_secret_url
    method: put
    payload: '{"enabled": {{ enabled }} }'
switch:
#########################################
#### LIVING ROOM - CLIMATE REACT    #####
#########################################

  - platform: template
    switches:
      climatereact_livingroom:
        value_template: "{{ is_state_attr('sensor.sensibo_living_room', 'enabled', true) }}"
        unique_id: 232343cb7e79-823372cade7e79
        friendly_name: Climate React - Living Room
        turn_on:
         - service: rest_command.sensibo_climate_react
           data: 
            deviceid: "abc12345d"
            enabled: "true"
         - delay: 1
         - service: homeassistant.update_entity
           entity_id: sensor.sensibo_living_room
        turn_off:
         - service: climate.turn_off ## OPTIONAL : Will turn OFF the A/C before disabling Climate React
           entity_id: climate.living_room ## Set this to the sensibo entity from the native integration.
         - service: rest_command.sensibo_climate_react
           data: 
            deviceid: "abc12345d"
            enabled: "false"
         - delay: 1
         - service: homeassistant.update_entity
           entity_id: sensor.sensibo_living_room

To workout which sensibo is what ID in the array e.g. [0],[1] and so on you can use

https://jsonpathfinder.com/

1 Like