Yeah, a trace log would definitely be helpful.
I will then try to get rid of the race condition.
I think I already know where it happens and the trace could confirm it.
Hi @mGoerentz ,
the latest update of the evcc binding to use websockets is a great improvement. And at the first glance it is working very nice. Thank you for that.
But I have a small issue with my battery values. I have two batteries configures in evcc. Both are discovered nicely as Things and receive correct initial values after linking Channels for power and SoC values. But after a few seconds - I guess when the websocket received an event - all the values changes to the total power an total SoC calculate by evcc. I looks like the event propagation / routing does not consider the index of the Thing configuration. Do you have a clue how to fix that?
I tied to collect TRACE log for you to debug my issue.
2026-10-18 10:48:19.455 [DEBUG] [.discovery.EvccThingDiscoveryService] - Starting evcc Discover
2026-10-18 10:48:19.456 [DEBUG] [.discovery.EvccThingDiscoveryService] - Thing discovered DiscoveryResult [thingUID=evcc:battery:api:battery0, properties={index=0, title=battery0}, representationProperty=title, flag=NEW, label=battery0, bridgeUID=evcc:server:api, ttl=-1, timestamp=2026-10-18T08:48:19.456245758Z]
2026-10-18 10:48:19.456 [DEBUG] [.discovery.EvccThingDiscoveryService] - Thing discovered DiscoveryResult [thingUID=evcc:battery:api:battery1, properties={index=1, title=battery1}, representationProperty=title, flag=NEW, label=battery1, bridgeUID=evcc:server:api, ttl=-1, timestamp=2026-10-18T08:48:19.456260369Z]
2026-10-18 10:48:22.427 [TRACE] [vcc.internal.api.EvccWebSocketClient] - Message received: {"battery":{"power":0,"capacity":11.799999999999999,"soc":18.64406779661017,"devices":[{"name":"solarbank-battery","power":-0,"capacity":1.6,"soc":10,"controllable":false},{"name":"powerocean-battery","power":-0,"capacity":10.2,"soc":20,"controllable":false}]}}
2026-10-18 10:48:22.428 [TRACE] [c.internal.handler.EvccBridgeHandler] - Received partial update: battery
2026-10-18 10:48:22.428 [TRACE] [vcc.internal.handler.CachedJsonState] - Partial state update: key='battery', value={"power":0,"capacity":11.799999999999999,"soc":18.64406779661017,"devices":[{"name":"solarbank-battery","power":-0,"capacity":1.6,"soc":10,"controllable":false},{"name":"powerocean-battery","power":-0,"capacity":10.2,"soc":20,"controllable":false}]}
2026-10-18 10:48:22.429 [TRACE] [c.internal.handler.EvccBridgeHandler] - Dispatching WebSocket update: key='battery', value type=JsonObject
2026-10-18 10:48:22.429 [TRACE] [ternal.handler.routing.MessageRouter] - Route matched for key 'battery': Route(battery -> battery): Fallback[MatchingObject{power}, JsonPath: $.devices[1]]
2026-10-18 10:48:22.430 [TRACE] [ternal.handler.routing.MessageRouter] - Extraction succeeded, dispatching to handler with dispatch key 'battery'
2026-10-18 10:48:22.430 [TRACE] [nternal.handler.EvccBaseThingHandler] - updateOnlyPresentChannels called with 4 entries
2026-10-18 10:48:22.430 [TRACE] [nternal.handler.EvccBaseThingHandler] - Processing update for key 'power' (channel 'battery-power'), checking if linked...
2026-10-18 10:48:22.431 [TRACE] [nternal.handler.EvccBaseThingHandler] - Updating linked channel battery-power
2026-10-18 10:48:22.431 [TRACE] [nternal.handler.EvccBaseThingHandler] - Processing update for key 'capacity' (channel 'battery-capacity'), checking if linked...
2026-10-18 10:48:22.432 [TRACE] [nternal.handler.EvccBaseThingHandler] - Channel battery-capacity not linked, skipping update
2026-10-18 10:48:22.433 [TRACE] [nternal.handler.EvccBaseThingHandler] - Processing update for key 'soc' (channel 'battery-soc'), checking if linked...
2026-10-18 10:48:22.433 [TRACE] [nternal.handler.EvccBaseThingHandler] - Updating linked channel battery-soc
2026-10-18 10:48:22.435 [TRACE] [nternal.handler.EvccBaseThingHandler] - Processing update for key 'devices' (channel 'battery-devices'), checking if linked...
2026-10-18 10:48:22.436 [TRACE] [nternal.handler.EvccBaseThingHandler] - Channel battery-devices not linked, skipping update
2026-10-18 10:48:22.436 [TRACE] [c.internal.handler.EvccBridgeHandler] - Update for key 'battery' was routed successfully via root key 'battery'
Ah, got It, seems like the routing is not respecting the index… Create an issue please, I will fix it as soon as possible.
The cause is the ordering of the routing in the EvccBatteryHandler.
I created a fix for it:
The evcc binding uses websockets since 5.3 and updates all channels on every websocket message, causing a huge load at times.
@mGoerentz can you please change it to only write if values have changed? Thanks!
Please also check [evcc] Bridge goes OFFLINE every minute: 30 s WebSocket watchdog is shorter than the evcc control cycle · Issue #22298 · openhab/openhab-addons · GitHub