(apologies if this is the wrong forum - please point me to a better one if need be)
I have been collecting “powerwall” data for a few months now, off a tesla gateway using the tesla powerwall integration. The gateway was connecting a PV system, an inverter and the grid. I feed information from HA to influxdb, then to grafana. It’s been working great, until today.
Today I had an actual battery installed and the sensor names all changed from powerwall_ to my_home_ (broadly). A lot of stuff broke. I renamed the relevant sensors and deleted the old ones, but in reality these are different sensors. I was hoping my grafana queries would rely on ‘friendly_name’ and would be OK, but they’re not. Influxdb still sees HA sensors using the original name, not the one I’ve set. Therefore either I lose all my historic data or I don’t get fresh data.
Is there a way to mitigate this issue somehow, even if it means manually changing all the affected sensors? At HA, at influxdb, even at grafana?
You need to change the new entity_ids to match the old entity_ids, not the friendly names. That’s what the data is tied to, both in home assistant and influxdb.
I did try that, it was my first port of call. I could get things working again on homeassistant with my automations and lovelace cards. But as mentioned in the OP influxdb still (only) sees the new names…
Thanks again @tom_l - I still cannot explain what is happening, but I found out that the same entities are still there and can be referenced by ‘entity_id’ as per the values I had set after the change happened. Before they were accessed via ‘friendly name’ which to my eyes has also been reverted, whereas influxdb disagrees with me on this.
For the most part, I have fixed or reverted the problem on grafana, whilst keeping the historical data, woohoo!