Animated Energy Widget

Hello @demichve

where do I found the icons from your widget?

The icons can be retrieved from the SMA web pages.

Do you have a link?

The icons are in the O.P. Right-click and save these.

Thank you so much for the updated version it looks great!

One thing I encountered, is that sometimes the lines between the icons are missing.
They are always missing if the battery supplies the whole home by itself.

For example here:
image

Do I miss something?

Have a look at the colours: green means that you battery is currently charging. So the state from your screenshot does not really makes sense. I assume that you have inverted signs for your battery power. Could you check that?

Thanks for the quick reply!

The battery power right now is negative (Energy Out), and the widget is green.
Do I need to invert the value for the widget to: Out = positive, In = negative?

Exactly. That’s just the way that my system reports it so I implemented the widget that way (I guess it was like that in the original version, too). You could also adapt the widget if you want. You would need to check every part of the logic where batterypower is used.

Thank you kindly!

A) for improving it, and
B) for sharing the improvement.

I installed it and it works. :slight_smile:

@DrRSatzteil thanks for the info, changing the < and > signs for both battery and grid did the trick for me!

I use a Solax-Inverter with the Solax-Binding to get the data. Solax seems to report both battery and grid inverse of your system.

If you used the Solax-Binding the following Channels are needed:

  • Local_Connect_Inverter_FeedIn_Power
  • Local_Connect_Inverter_Power_Usage
  • Local_Connect_Inverter_PV_Total_Power
  • Local_Connect_Inverter_Battery_Power
  • Local_Connect_Inverter_Battery_Level

Tobias, Thomas and all,
please help maintaining one single version of this widget by parametrizing it rather than to create alternative versions to use for hardware X or in use case Y.
We’ll quickly lose overview else which code version to use.

You could for example pass a new boolean parameter invertedBatteryCharging and change the comparison code line to be if-invertedCharging-then-“>” else “<” so it takes care of the proper calculation depending on the new parameter.
Same issue exists for grid feed in value, some meters report that as positive where others show a negative value, so another parameter to dynamically adapt that would be useful, too.

2 Likes

Yes Im working on that already but wanted to post an intermediate fix as many use solax. Will delete it!

1 Like

Hello DrRSatzteil,

I think I’m having trouble; my issue is that when I’m selling electricity, the animation shows towards total consumption instead of from the solar panels to the grid. Similarly, when I charge the battery, the animation shows from solar to grid instead of from solar to battery.

Sounds like your inverter reports values with different signs (negative values where the widget expects positive and vice versa). See the discussion directly above. There is no improved version of the widget yet that would allow you to change the widget behaviour. Strohhut posted his quick solution above (replace < with > and vice versa)

Hi all,

I just wanted to share my version of the widget - unfortunately this is an additional version, because I haven’t followed this thread for a while and worked on my adjustments to the widget for my own.

My version is basically a major overhaul that utilizes the new oh-context component to inject functions such as for state formatting into the widget context and thereby reduce code duplication.
The use of oh-context functions should also make it easier to make this widget configurable for other inverters with other sign interpretations.
In addition to that, I have fixed an issue with the styling, where the center col grows to full size instead of centering the widget content in the middle of the widget.

You can check out the source code on GitHub: openhab-conf/UI/widgets/florianh-widgetset/emsEnergyflow.yaml at main · florian-h05/openhab-conf · GitHub

2 Likes

I should probably add that I’ve found a bug in the oh-context component that makes it not work when not in widget edit mode, I’ve already fixed and backported the fix to 4.2.x, but at the moment you either have to use a snapshot, deploy only the UI bundle or wait for 4.2.1.