GivTCP: some values not updating, but others do

10 comments started 2022-12-18 last 2022-12-18
APIsHome AutomationHome Assistant
#1 Riscy

I'm using the excellent GivTCP in Home Assistant, v2.0.6, doing an MQTT push into the same HA instance.

Often it gets into a position where some of the properties aren't updating. E.g. the raw.inverter.system_time updates continuously, but all the Flows get stuck at zero. Other times it's the battery charge level. Often it comes back if I restart GivTCP.

Important to note that the same metrics in the GE Android App (on local connection mode) are showing correctly at the same time. I've changed the logging mode to "Debug" and repro'd the issue but can't see anything in the logs that looks relevant.

I'm quite happy to go delving through the codebase, thanks to the wonder of open-source. But before I do so, is anyone aware of something I might be doing wrong that's causing the behaviour?

Cheers

T
#2 Tim

Riscy might be worth a shout out to @Britkat whose code it is to see if he’s aware.

#3 TheDragon (GivEnergy)

I see this too on many entities.
Battery SoC, temperatures.
Has something to do with the rate of change filters.
Annoying when your trying to track for testing and this happens. Restart GivTCP to get the entity back in line

#4 Riscy

Looking through the source code, the smoothing algorithm isn't applied to the power flow readings. So I don't think that's related on this occasion.

I could fancy a crack at tweaking the smoothing algorithm so that it's based on a delta-per-unit-time rather than a fixed amount in a hard 60 second limit. And/or a config option to disable smoothing for those of us who are (mad) enough to implement it downstream in HA. @Britkat you've done an excellent job - I'd love to get involved if I can help at all.

But yes, the problem I saw with zero power-flows doesn't seem related to smoothing.

#5 TheDragon (GivEnergy)

Riscy I'm sure he would be glad of the assistance, he is a busy man

G
#6 godfreym

You could create an automation that restarts GivTCP if the battery temperature hasn't changed in a 15 minute period.
Just set a condition for any of the entities that you are concerned about.
eg.
- condition: template
value_template: >-
{{ (as_timestamp(now()) -
as_timestamp(states.sensor.givtcp_bgxxxxxxxx_battery_temperature.last_updated))
> 900 }}

A
#8 anglefire

godfreym only works (I guess) if running it as an addon to Homeassistant.

G
#9 godfreym

anglefire That would be correct

A
#10 anglefire

Changed my smoothing setting to low the other day - and today after no sun to speak of, the SOC dropped to 3 then 2%. A charge kicked in to take it back to 5 then 4% - seems to have done the trick at the moment (I'm running in a Docker and not an addin)