Skip to content

Revised Wallbox Handling (release - 2'nd try)

Choose a tag to compare

@marq24 marq24 released this 30 Jan 17:06

After the initial release of the revised wallbox handling it has been reported (thanks Werner!) that it looks like that SenecApp developers made use over very special boolean algebra. It seams to be, that true must be treated as false, while false probably would mean true, but of course this seams to be valid only in a very tiny area of the Wallbox handling. Details are again in #190. I would be really happy to get some insights, why this is implemented in that way. Anyway - let's hope that we can close this chapter now for Senec V2 and V3 Systems... Still I am looking for somebody who can share with me API request/responses of the SenecApp for Senec V4/P4 systems.

In #190 and #193 there are multiple issues discussed concerning the Wallbox control via the SENECApp and how the WebAPI.integration and LOCAL.integration behaves. In the last weeks I spend quite an amount of time trying to find a good compromise between obvious changes in the SenecAPP user interface and the different implementations of the two integration variants.


Let's start with some basics

Theorie of operation - SENEC V2 V3 Systems ONLY

First let me start, that I don't have a SENEC wallbox myself - so all this has been developed remotely. But here is what I have understood so far: As SENEC Wallbox owner the only option to control your Wallbox is via the SENECApp. There are no controls for Senec V2, V3 Owners at the main unit in your home.

When you adjusting any values in the SENECApp, then it takes at least one sync cycle (unknown update interval) that your local Senec system will adopt to your adjustments. Since you change something in the App, the App communicates with Senec backend systems somewhere in the Internet, then this backend must communicate with your local Senec device @ home.

What the integration has done (before the update)

  1. WebAPI.integration tried to replicate the functionality present in the SENEC.App and had provided similar controls - so making adjustments to the wallbox controls in the integration should had the same effect, then doing it via the SENEC.App
  2. Instead of waiting, till the backend systems will notify your local Senec system, the LOCAL.integration was notified, by the WebAPI.integration when you made certain adjustments and then the LOCAL.integration already made the required changes at your Senec device @ home. So that there was nothing left to do, when the default backend sync would kick in (after the unknown backend delay)

What has changed in the new release

Senec WebAPI integration

  • Allow Intercharge Switch has been removed (this will be now toggled individually per Wallbox via a new mode)
  • BREAKING CHANGE: Wallbox Mode fastest has been renamed to fast_with_battery
  • Wallbox Mode fast has been introduced
  • Set Wallbox mode to 'fast_with_battery' will turn ON 'Allow Intercharge' in LOCAL integration
  • Set Wallbox mode to anything different then 'fast_with_battery', will check, if any other Wallbox mode is still 'fast_with_battery' and if this is not the case, 'Allow Intercharge' in LOCAL integration will be switched OFF
  • wallbox_[1-4]_state sensor entities have now additional attributes (further details below)

Senec LOCAL integration

  • Toggle 'Allow Intercharge' will check, if ANY of the WB's is in 'fast' or 'fast_with_battery' (if this is not the case the toggle will not be performed)
  • Turn 'Allow Intercharge' ON, will set WB mode to 'fast_with_battery' ONLY for Wallboxes that had previously the state 'fast'
  • Turn 'Allow Intercharge' OFF, will set WB mode to 'fast' ONLY for Wallboxes that had previously the state 'fast_with_battery'

Additional Sensor data, in the attributes

The WebAPI Sensor's wallbox_[1-4]_state have now additional attributes. Yes this is the first time that this integration introduced attributes. Beside the state a sensor can provide an additional JSON object that can be used as source of template Sensors - or with any automation. This allow to add multiple fields/data without the need for additional sensors.

The new attributes are named json and modes (but you can also verify this via http://[your-ha-ip]:8123/developer-tools/state

How to access attributes in HA templates?

Assuming all your WebAPI Sensors have the prefix senec_webapi, then you can use the state_attr method to access on of the attribues like this:

{% my_data=state_attr("sensor.senec_webapi_wallbox_1_state", "json") %}
{{ my_data }}

json

The {{ state_attr("sensor.senec_webapi_wallbox_1_state", "json") }} is the overall content of the wallbox properties that was received from the API (it should look quite similar to the json I have recently posted) - the content will also help us in the future to debug issues - since now you can check yourself, what the Senec backend will provide.

modes

The {{ state_attr("sensor.senec_webapi_wallbox_1_state", "modes") }} is a object, that will contain three values:

  • integration the current wallbox mode the integration has (this should/must be identical to the wallbox mode select entity)
  • senec the current mode that is present in the chargingMode:type, expected values are: FAST or SOLAR
  • restore the integration mode that should be restored when LOCKED will be switched off [the content of this attribute is only different to integration, when the integration value is locked ]

Locking & unlocking the wallbox via an automation

When you set a wallbox to the LOCK state by an automation you will face the challenge, what should be the mode when you want to unlock the wb again? In the Senec.APP there is a simple toggle, to LOCK/UNLOCK - but in this integration I have decided to use a Enumeration to switch though all the possible different modes. So when you want to unlock your wallbox, you can find the mode to set via this template {{ state_attr("sensor.senec_webapi_wallbox_1_state", "modes").restore }}. This is the mode you should set when you want to UNLOCK your Wallbox e.g. when your car is located at home

Please consider supporting me

Thanks to those who have already supported me in the past weeks or month that is highly appreciated! To the other users: I am putting quite an amount of energy and passion into this integration. Perhaps you could give yourself a little push (if you can afford it) and become a sponsor.

GithubSponsor Revolut Wero PayPal BuyMeCoffee Github Stars
If you haven't starred this integration in Github yet - please do so - TIA