Sensibo widget for openHAB 3

Note: Binding has changed the capitalisation since this post use code in post 16

With the help of the community I have created an Sesibo widget.

Here is what I have the widget looks like

After installing the binding and getting it online. With api key

Add you aircons as things

Then goto MODEL

Create equipment from thing
Select all items

Remember the name e.g. BedroomAircon

Now got Developer Widgets create a new widget and replace with…

uid: Sensibo_ACcontroller
tags: []
props:
  parameters:
    - description: The Label at the top of the card
      label: Friendly name of your aircon eg. Lounge
      name: title
      required: false
      type: TEXT
    - description: The index of your items aircon foo_targetTemperature = foo
      label: The index name of your aircon
      name: airconditioner
      required: true
      type: TEXT
  parameterGroups: []
timestamp: Dec 5, 2020, 12:03:56 PM
component: f7-block
config:
  style:
    --f7-button-text-color: var(--f7-text-color)
    --f7-button-bg-color: var(--f7-card-bg-color)
    --f7-theme-color-rgb: var(--f7-color-blue-rgb)
  class:
    - no-padding
slots:
  default:
    - component: Label
      config:
        class:
          - margin
          - no-padding
        text: =props.title
        style:
          text-align: center
          height: auto
          font-size: 16px
          --f7-button-text-color: var(--f7-text-color)
          --f7-button-bg-color: var(--f7-card-bg-color)
          --f7-theme-color-rgb: var(--f7-color-blue-rgb)
    - component: f7-row
      config:
        class:
          - margin
      slots:
        default:
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    action: toggle
                    actionItem: =(props.airconditioner + "_MasterSwitch")
                    actionCommand: ON
                    actionCommandAlt: OFF
                    icon-f7: power
                    iconSize: 28
                    iconColor: '=(items[props.airconditioner + "_MasterSwitch"].state === "OFF") ? "red" : "green"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      height: auto
                      font-size: 12px
          - component: f7-col
            config:
              style:
                text-align: right
            slots:
              default:
                - component: Label
                  config:
                    text: =items[props.airconditioner + "_CurrentTemperature"].state.displayState || items[props.airconditioner + "_CurrentTemperature"].state
                    style:
                      white-space: nowrap
                      text-overflow: elipsis
                      heigh: auto
                      font-size: 12px
                - component: Label
                  config:
                    text: =items[props.airconditioner + "_CurrentHumidity"].displayState || items[props.airconditioner + "_CurrentHumidity"].state
                    style:
                      white-space: nowrap
                      text-overflow: elipsis
                      heigh: auto
                      font-size: 12px
    - component: f7-row
      config:
        class:
          - justify-content-center
      slots:
        default:
          - component: oh-knob
            config:
              min: 18
              max: 30
              stepSize: 1
              size: 270
              item: =[props.airconditioner + '_targetTemperature']
    - component: f7-row
      config:
        class:
          - margin
      slots:
        default:
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_mode')
                    actionCommand: ="auto"
                    icon-f7: arrow_2_circlepath
                    iconColor: '=(items[props.airconditioner + "_mode"].state === "auto") ? "red" : "gray"'
                    text: AUTO
                    textColor: '=(items[props.airconditioner + "_mode"].state === "auto") ? "red" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_mode')
                    actionCommand: ="heat"
                    icon-f7: thermometer_sun
                    iconColor: '=(items[props.airconditioner + "_mode"].state === "heat") ? "orange" : "gray"'
                    text: HEAT
                    textColor: '=(items[props.airconditioner + "_mode"].state === "heat") ? "black" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_mode')
                    actionCommand: ="dry"
                    icon-f7: drop
                    iconColor: '=(items[props.airconditioner + "_mode"].state === "dry") ? "yellow" : "gray"'
                    text: DRY
                    textColor: '=(items[props.airconditioner + "_mode"].state === "dry") ? "black" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_mode')
                    actionCommand: ="fan"
                    icon-f7: wind
                    iconColor: '=(items[props.airconditioner + "_mode"].state === "fan") ? "white" : "gray"'
                    text: FAN
                    textColor: '=(items[props.airconditioner + "_mode"].state === "fan") ? "black" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_mode')
                    actionCommand: ="cpp;"
                    icon-f7: thermometer_snowflake
                    iconColor: '=(items[props.airconditioner + "_mode"].state === "cool") ? "blue" : "gray"'
                    text: COOL
                    textColor: '=(items[props.airconditioner + "_mode"].state === "cool") ? "blue" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
    - component: f7-row
      config: {}
      slots:
        default:
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    action: options
                    actionItem: =(props.airconditioner + '_fanLevel')
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    icon-f7: chart_bar
                    iconColor: yellow
                    size: 20
                    text: =items[props.airconditioner + '_fanLevel'].state
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      font-size: 12px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    action: options
                    actionItem: =(props.airconditioner + '_swingMode')
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    icon-f7: arrow_up_down_circle
                    iconColor: green
                    size: 20
                    text: =items[props.airconditioner + '_swingMode'].state
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 12px
                      height: auto

Save and goto your pages add a new widget

Configure your widget

image

Thanks to those who made this possible its a long list of people.

4 Likes

Thank you, this looks great! I would love to use this for my tado powered radiators.
grafik

The things have the class class Equipment_RadiatorControl, but the properties seem to be almost the same. I tried entering the Thing name where you entered “BedroomAircon” in the screenshot, but it doesn’t seem to work.

Do I get this right? “airconditioner” in your code is a variable, and it tries to get the properties of it?

For example, my thing also has the property/point “targetTemperature”, so at least this should work … but it doesn’t :frowning:

How would I start to adapt this properly?

Yes

Enter TadoKuche and it should work.

You can also change those lines to hard code the items.

1 Like

Yes, got it to work! It seems it’s case sensitive AND there is some caching going on (changed the case first, still didn’t work on my test page). But I also discovered now, that you can set the properties in the preview as well and there it worked.

I’ll make a proper port for tado after work :slight_smile:

You can change the name airconditioner in widget to item. Then if you set it as the default standalone widget for your equipment it will auto populate the name.

I need to update OP

Hi James, I’ve got a Sensibo Sky and would really like to have it working in openHAB. My Bridge is fine, no worries there but how did you get your AC to get over the “Initializing” hump? My Thing using the Sensibo bridge has been stuck on Initializing and doesn’t come out to play.

Did you get it working. Try installing the JSON path transformation

No, not yet. Not to worry - persistence and determination are omnipotent!

Yep, I’ve got the JSON transformation in and running but you’ve given me a good tip. I’ll check my config and make sure the binding and thing know to use it for communicating with my Sky.

Hmm…no dice. The config looks correct, I’ve put my API in and that works for the bridge - got the MAC address correct, tried both with and without semicolons. Is there supposed to be some login info along with the API for the bridge?

Here’s the code (API Key scrambled)

UID: sensibo:account:sensibobridge
label: Sensibo API
thingTypeUID: sensibo:account
configuration:
apiKey: nopenopenopenopenope
refreshInterval: 120
location: Lounge Room

Here’s the code for the Sensibo controller (mac scrambled)

UID: sensibo:sensibosky:sensibobridge:senibocontroller
label: Sensibo Controller
thingTypeUID: sensibo:sensibosky
configuration:
macAddress: nopenopenopenope
bridgeUID: sensibo:account:sensibobridge
location: Lounge Room

No the Key is you authentication.

You shouldent need to enter anything else in.

You have a working bridge

Goto image

Click on image in the bottom right corner

Then select the sensibo binding

Click image

It should show up under discovered things that you can click on and add as a new thing

1 Like

Perfect! Found it. Thanks James, excellent outcome. Looking at the code, the scan found it and used the MAC address all in upper case as the last characters in the UID and in the macAddress field.

Funny - small differences but it works really well now.

Here’s what the scan code looks like:

UID: sensibo:sensibosky:sensibobridge:[Redacted the MAC address all in upper with no colons]
label: Sensibo skyplus Living Room
thingTypeUID: sensibo:sensibosky
configuration:
->(i.e. indent by two spaces) macAddress: [Redacted the MAC address all in upper with no colons]
bridgeUID: sensibo:account:sensibobridge
location: Lounge Room

1 Like

thanks for the widget,
But only these work in a widget
1

I checked the thing and the items, everything is fine

no one can help me?

Did you Create equipment from thing This way it sets all the item names correctly.
Or it did when I did it last year.

Can you send me a list of your item names

i did Create equipment from thing

1

Thanks for posting pic I see the problem as I created the items in 3.0.0 version of binding.

I just made the widget I didn’t develop the binding. The binding has been updated so now its TargetTemperature not targetTemperature this is what broke the widget as I assume you are running 3.0.2.

Change the code to reflect this change.

uid: Sensibo_ACcontroller
tags: []
props:
  parameters:
    - description: The Label at the top of the card
      label: Friendly name of your aircon eg. Lounge
      name: title
      required: false
      type: TEXT
    - description: The index of your items aircon foo_TargetTemperature = foo
      label: The index name of your aircon
      name: airconditioner
      required: true
      type: TEXT
  parameterGroups: []
timestamp: Dec 5, 2020, 12:03:56 PM
component: f7-block
config:
  style:
    --f7-button-text-color: var(--f7-text-color)
    --f7-button-bg-color: var(--f7-card-bg-color)
    --f7-theme-color-rgb: var(--f7-color-blue-rgb)
  class:
    - no-padding
slots:
  default:
    - component: Label
      config:
        class:
          - margin
          - no-padding
        text: =props.title
        style:
          text-align: center
          height: auto
          font-size: 16px
          --f7-button-text-color: var(--f7-text-color)
          --f7-button-bg-color: var(--f7-card-bg-color)
          --f7-theme-color-rgb: var(--f7-color-blue-rgb)
    - component: f7-row
      config:
        class:
          - margin
      slots:
        default:
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    action: toggle
                    actionItem: =(props.airconditioner + "_MasterSwitch")
                    actionCommand: ON
                    actionCommandAlt: OFF
                    icon-f7: power
                    iconSize: 28
                    iconColor: '=(items[props.airconditioner + "_MasterSwitch"].state === "OFF") ? "red" : "green"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      height: auto
                      font-size: 12px
          - component: f7-col
            config:
              style:
                text-align: right
            slots:
              default:
                - component: Label
                  config:
                    text: =items[props.airconditioner + "_CurrentTemperature"].state.displayState || items[props.airconditioner + "_CurrentTemperature"].state
                    style:
                      white-space: nowrap
                      text-overflow: elipsis
                      heigh: auto
                      font-size: 12px
                - component: Label
                  config:
                    text: =items[props.airconditioner + "_CurrentHumidity"].displayState || items[props.airconditioner + "_CurrentHumidity"].state
                    style:
                      white-space: nowrap
                      text-overflow: elipsis
                      heigh: auto
                      font-size: 12px
    - component: f7-row
      config:
        class:
          - justify-content-center
      slots:
        default:
          - component: oh-knob
            config:
              min: 18
              max: 30
              stepSize: 1
              size: 270
              item: =[props.airconditioner + '_TargetTemperature']
    - component: f7-row
      config:
        class:
          - margin
      slots:
        default:
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_Mode')
                    actionCommand: ="auto"
                    icon-f7: arrow_2_circlepath
                    iconColor: '=(items[props.airconditioner + "_Mode"].state === "auto") ? "red" : "gray"'
                    text: AUTO
                    textColor: '=(items[props.airconditioner + "_Mode"].state === "auto") ? "red" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_Mode')
                    actionCommand: ="heat"
                    icon-f7: thermometer_sun
                    iconColor: '=(items[props.airconditioner + "_Mode"].state === "heat") ? "orange" : "gray"'
                    text: HEAT
                    textColor: '=(items[props.airconditioner + "_Mode"].state === "heat") ? "black" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_Mode')
                    actionCommand: ="dry"
                    icon-f7: drop
                    iconColor: '=(items[props.airconditioner + "_Mode"].state === "dry") ? "yellow" : "gray"'
                    text: DRY
                    textColor: '=(items[props.airconditioner + "_Mode"].state === "dry") ? "black" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_Mode')
                    actionCommand: ="fan"
                    icon-f7: wind
                    iconColor: '=(items[props.airconditioner + "_Mode"].state === "fan") ? "white" : "gray"'
                    text: FAN
                    textColor: '=(items[props.airconditioner + "_Mode"].state === "fan") ? "black" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    action: command
                    actionItem: =(props.airconditioner + '_Mode')
                    actionCommand: ="cpp;"
                    icon-f7: thermometer_snowflake
                    iconColor: '=(items[props.airconditioner + "_Mode"].state === "cool") ? "blue" : "gray"'
                    text: COOL
                    textColor: '=(items[props.airconditioner + "_Mode"].state === "cool") ? "blue" : "gray"'
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 8px
                      height: auto
    - component: f7-row
      config: {}
      slots:
        default:
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    action: options
                    actionItem: =(props.airconditioner + '_FanLevel')
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    icon-f7: chart_bar
                    iconColor: yellow
                    size: 20
                    text: =items[props.airconditioner + '_FanLevel'].state
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      font-size: 12px
                      height: auto
          - component: f7-col
            slots:
              default:
                - component: oh-button
                  config:
                    action: options
                    actionItem: =(props.airconditioner + '_SwingMode')
                    class:
                      - margin
                      - display-flex
                      - flex-direction-column
                    icon-f7: arrow_up_down_circle
                    iconColor: green
                    size: 20
                    text: =items[props.airconditioner + '_SwingMode'].state
                    style:
                      --f7-button-bg-color: transparent
                      --f7-button-hover-bg-color: transparent
                      --f7-button-pressed-bg-color: transparent
                      font-size: 12px
                      height: auto
1 Like

Thank you, it works smoothly

Hi there, I’m progressing to HABPanel and page setup. I’ve successfully added your widget to my openHAB developed widgets (thank you, it’s pretty cool) but have a noob question, sorry.

How is this widget added to HABPanel?

Sorry I don’t use HABPanel and the widgets are not compatible

Yep, fair enough.