Overkiz integration - Local API [Development / Testers topic]

I want to try the local api solution!

A couple questions though, the latest beta version doesn’t contain the Overkiz local solution, when I look for it on the integration page, is that correct?

After this can I remove my account on the Somfy website?
Does everything work (completely) locally or does some data still go to the cloud?
What are the real benefits? Not dependent on the cloud, so I think more reliable, but does it also work faster? for instance the request to close a shutter.

Thanks!

It is the same integration! When you set up the integration you can choose for Local API or Cloud API.

You could, but I would keep it, just in case… When you set up the local API, you will need to login with your Somfy cloud credentials to generate an API token.

Afterwards, the integration works fully local and doesn’t connect to any cloud service. It should be more reliable (depending on your home network :wink: ) and slightly faster, but not sure if this is really noticeable.

1 Like

The speed and the Cloud API limits were the main reasons for me why I didn’t use the Cloud implementation before and used Homebridge which already supports local API for more than a year.

The delays were really 1-3secs with Cloud API and are now instant with the Local API.

Still busy trying to make my RTS shades ‘stateful’ with logical use. The sample given on the integration page is too ‘optimistic’ as it changes directly to Open or Closed when a button is pressed.

2 Likes

I’ve tested the config flow with the latest beta and it works like a charm. After the setup it takes some seconds until the integration shows devices but they appear.

Control of the devices works instantly.

One general question:
I’ve am using Overkiz Cloud in my prod system. Can i reconfigure the integration to local api after the official release or is it required to delete the integration and re-add it?

A cosmetic question:
Overkiz Cloud shows a device and model name for my Tahoma Switch

The local integration shows only the device key and no model:

Is that a tiny bug or is it not possible to identify the device name and model with local api?

Thanks again for all your time and effort to make a local API possible!!! I will create a Youtube video about it. Thats my way to contribute to your development and say thank you and hopefully you will get some donations. I hope thats ok for you?

In the first release you will need to remove and add a new config entry. My plan is to allow to set up the local API, which will replace your current config entry. However, adding this local API took over a year due to the limited time I have at the moment, so I just wanted to have an initial version released now :wink: .

The Local API doesn’t provided this information indeed :slight_smile:, hope they will add this (and other missing elements) in the future.

here is how I handle it Overkiz API and Somfy API - #1997 by andyblac

1 Like

Looks great, one question about it
why is the binary_sensor needed? (Andys Shade Helper)?

to store the state of the somfy shade.

- trigger:
    - platform: state
      entity_id:
        - cover.media_room_somfy_window_shade
      id: "on"
      from: opening
      to: unknown
    - platform: state
      entity_id:
        - cover.media_room_somfy_window_shade
      id: "off"
      from: closing
      to: unknown
  binary_sensor:
    - name: Media Room Shade Helper
      unique_id: a5c19860-c74d-4b25-8893-982e8b135bcd
      state: "{{ trigger.id }}"

What kind of helper is it?

it a template binary helper (on off), not a normal helper.

I have done it a bit different from your example, thanks to get me in the right direction.

  • cover.keuken_gordijn_rts is the ID I have given the entity provided by Overkiz
  • cover.keuken_gordijn is the new cover and sensor.keuken_gordijn is the status helper for the state changes.
template:
  - trigger:
      - platform: state
        entity_id: cover.keuken_gordijn_rts
        id: opening
        to: opening
      - platform: state
        entity_id: cover.keuken_gordijn_rts
        id: open
        from: opening
        to: unknown
      - platform: state
        entity_id: cover.keuken_gordijn_rts
        id: closing
        to: closing
      - platform: state
        entity_id: cover.keuken_gordijn_rts
        id: closed
        from: closing
        to: unknown
    sensor:
      - name: Keuken Gordijn
        state: "{{ trigger.id }}"
        unique_id: keuken_gordijn

cover:
  - platform: template
    covers:
      keuken_gordijn:
        device_class: shade
        friendly_name: "Keuken Gordijn"
        unique_id: keuken_gordijn
        close_cover:
          service: cover.close_cover
          target:
            entity_id: cover.keuken_gordijn_rts
        open_cover:
          service: cover.open_cover
          target:
            entity_id: cover.keuken_gordijn_rts
        stop_cover:
          service: cover.stop_cover
          target:
            entity_id: cover.keuken_gordijn_rts
        value_template: "{{states('sensor.keuken_gordijn')}}"

Now for my next challenge. I want to add ‘percentage’ state so 0% = closed, 50% = my button, 100% is open and that only these three steps can be chosen when dragging the slider.

I have tried, but with RTS the somfy hub does not know the %, I am not even sure you could hack it, but with my button in my example it does show as ‘open’ as somfy seems to fully close the shade then re-open it to the my_position when activated.

RTS itself does not have any state or percentage.

But this should be possible as I had it working like that with the TaHoma HomeBridge plugin. With HomeBridge linked to Home Assistant.

The HomeBridge plugin kept the state between 0-50-100% but you could select any percentage between 0-100%.

But as Overkiz now has Local API I really want to do this ‘native’ in just Home Assistant.

btw, you can clean up your code a little bit

using your template code you can change

this:

        value_template: >
          {% if states('sensor.keuken_gordijn') == 'opening' %}
            opening
          {% elif states('sensor.keuken_gordijn') == 'open' %}
            open
          {% elif states('sensor.keuken_gordijn') == 'closing' %}
            closing
          {% elif states('sensor.keuken_gordijn') == 'closed' %}
            closed
          {% else %}
            unknown
          {% endif %}

to this:

      value_template: "{{states('sensor.keuken_gordijn')}}"

i would like to know if you manage it, as atm if you close the shade a little, with my code it thinks the shade is fully closed, thats only downside.

Thanks, I cleaned up my code and post with that change.

To all devs and coders. The ESPSomfyRTS project offers a handy method to caculate a state in %.
https://github.com/rstrouse/ESPSomfy-RTS
Once ESPSomfyRTS setup is finished there is an option for each cover to set start and end time a cover needs for open and close. Then based on the time the percentage state is calculated.

I would be really cool to get such an option for Overkiz motors. Would that be possible?

This is not allowed in the integration itself. As the policy within the HA development is that the state needs to be real which is not possible with RTS.

With a Template Cover it should be possible to recreate this.

The HomeBridge Tahoma plugin has this implemented by the way, where you can set the time of opening/closing and it gives an estimated percentage. It was never accurate enough for me though, so only used 0% (close) - 50% (my) - 100% (open) which I want to recreate in HA now.

Unfortunately, this won’t be implemented for the Overkiz integration in core. The HA policies don’t accept this, as mentioned by @danieldeni. The core focus of the Overkiz integration is the control of your Overkiz devices.

It would be possible to use a custom component (or advanced template) to have a ‘stateful’ RTS cover, controlled by the Overkiz integration. But I don’t have time to build this and/or support this.

There it is…the announcement of the announcements :slight_smile:

image

2 Likes