How do I change Energy settings while keeping historic data

Three years ago I installed 3 shelly3em devices to monitor the grid consumption for “normal” and heat pump usage, and the energy returned from my PV panels, 100% feed to the grid.
After the latest update of HA my config looks like this:


Now my electrician installed a battery and rewired a lot so that I consume my own PV energy. I will add another shelly to measure the battery energy flows (as - as of now - there is no working integration for the battery).
Now I want to change my energy settings, but not loose historic data. The heat pump stays like it is, but of course I need to change the settings for PV and normal usage to reflect reality, and add the new shelly for battery. How do I do this? I thought about resetting the PV and normal usage device to factory, rename the existing entities to “legacy”. But I have read that once I reuse the old shellys for solar etc HA will “repair” everything so it gets messed up?
Can anyone guide me to best practise here? Thanks

I’d reconfigure your Shelly 3EM devices for “triphase” mode. Then, they will show as new entities. Install your 3rd Shelly the same way, once you buy it. Then, you’ll add a single entity for each Shelly device (not 3). HA will complain that the entity is lost, but you can ignore that to keep historical data.

Hm, there does not seem to be any way to configure the Shelly 3M in a different way. I cannot find any option in the web interface, and also not in the manual.

Hi there!

perhaps it would help if you could describe this in a bit more detail… ‘rewired a lot’ can also mean ‘a lot’ of things :wink:

Do you have some more description of what was actually changed, the type of PV and battery, etc? You clearly already had 3p, so that’s not it, and if you are looking to change the energy settings to reflect the real consumption in your house: being able to meadure battery I/O is indeed key and would probably require a few template helpers to show you the exact house energy consumed.

I’m speculating here a bit, but that’s my first thought… If you have a smart meter, that can also help and maybe is worth investigating as an alternative to a shelly 3EM?

“Rewiring” means switching from 100% feeding the solar power into the grid to installing a battery and using self-consumption as good as possible…
But I think I managed: fiddling with the database (in table statistics_meta renaming the respective sensors to some non existing names and editing the config file for energy /.storage/energy to use these new names) I have the history fixed forever, I hope.
Alas, having set up the new entities the power flow chart looks strange, but I will open a new topic for this.

Shelly’s documentation is lacking here. Goto the web interface of the device → Settings → Device Profile. This setting toggles between showing 1 energy device (sum) or 3 separate ones.

Also, it would help to know what country you’re in and what the grid is like there… 3 phase, single phase, us dual 120v phase, etc. etc.

Ok, Now I understand, because today my new 3em PRO arrived…indeed it has this setting. But the old ones are 3em (w/o pro), they do not have this setting.

I am in Germany, and thanks anyway, as I have written above I think I found a solution by dealing with the internals of HA.