-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[evcc] Adjust to breaking API change and add Battery Capacity channel #14245
Conversation
...es/org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/EvccHandler.java
Show resolved
Hide resolved
Seems this is only for writing. Reading via Are you sure this is an intentional API change or rather an EVCC bug ? Did you ask over at their forum ? |
Reading though evcc-io/evcc#5522, it seems that this change was intentional. It explains as well why the SoCs aren’t working anymore. evcc changed all ids to start with 1 (loadpoints API!!), but I think we shouldn’t follow to „rename“ the channels to avoid user breaking changes. |
0edc6b0
to
e79c7ef
Compare
evcc-io/evcc#5649 probably brings more breaking changes. |
Fixes openhab#14231. See evcc-io/evcc#5522. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
e79c7ef
to
426a8af
Compare
@jlaur Since this has been verified to fix the issue, this is ready for merging from my side! |
...enhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/EvccBindingConstants.java
Outdated
Show resolved
Hide resolved
@@ -257,6 +258,7 @@ public void dispose() { | |||
private void createChannelsGeneral() { | |||
final String channelGroup = "general"; | |||
if (batteryConfigured) { | |||
createChannel(CHANNEL_BATTERY_CAPACITY, channelGroup, CHANNEL_TYPE_UID_BATTERY_CAPACITY, "Number:Energy"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a comment for future consideration: Instead of dynamically creating channels, they could be statically declared in XML and then removed when not needed. See for example #13275. The reason for doing so would be simplification.
bundles/org.openhab.binding.evcc/src/main/resources/OH-INF/i18n/evcc.properties
Show resolved
Hide resolved
bundles/org.openhab.binding.evcc/src/main/resources/OH-INF/i18n/evcc.properties
Show resolved
Hide resolved
Addresses review. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Addresses review. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@jlaur This is ready for re-review 👍 |
Addresses review. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@jlaur Do you think this is something to include in a 3.4.2 Patch release (if there’s one)? |
@florian-h05 - ideally it should then have been a pure bugfix PR without introduction of a new channel. But since I understand that the binding is quite broken for all users having upgraded to evcc 0.111, I agree it's a candiate. @openhab/add-ons-maintainers, okay to cherry-pick this one? |
@lolodomo - would you agree to cherry-pick this? |
@jlaur @lolodomo In the current 3.4.1 version the change of the mode won't do anything. I modified the state in the unreleased market place version of the binding and it works again. |
@kaikreuzer - if you agree, please cherry-pick this commit, f808edf, and 988fde1 as well (from #14381) into the 3.4.x branch before starting a build. Thanks! |
* [evcc] Adjust to breaking API changes Fixes #14231. See evcc-io/evcc#5522. * [evcc] Add battery capacity channel * [evcc] Version & openHABian note * [evcc] Use already defined constants in ChannelTypeUIDs * [evcc] Correct header in evcc.properties Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Sure @jlaur, I have cherry-picked those two fixes to |
* [evcc] Adjust to breaking API changes Fixes openhab#14231. See evcc-io/evcc#5522. * [evcc] Add battery capacity channel * [evcc] Version & openHABian note * [evcc] Use already defined constants in ChannelTypeUIDs * [evcc] Correct header in evcc.properties Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* [evcc] Adjust to breaking API changes Fixes openhab#14231. See evcc-io/evcc#5522. * [evcc] Add battery capacity channel * [evcc] Version & openHABian note * [evcc] Use already defined constants in ChannelTypeUIDs * [evcc] Correct header in evcc.properties Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
* [evcc] Adjust to breaking API changes Fixes openhab#14231. See evcc-io/evcc#5522. * [evcc] Add battery capacity channel * [evcc] Version & openHABian note * [evcc] Use already defined constants in ChannelTypeUIDs * [evcc] Correct header in evcc.properties Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Fixes #14231.
evcc changed the API with version 0.111.0, see evcc-io/evcc#5522.
This API change breaks the binding:
I have also added a new channel for the home battery's capacity which is a new value available over the API.
Signed-off-by: Florian Hotze florianh_dev@icloud.com