# \[fronius\] How to get the daily total energy consumption and grid import/export?

**URL:** <https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332>\
**Category:** Bindings\
**Created:** [December 2, 2020, 3:13pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332 "2020-12-02T15:13:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [December 2, 2020, 3:13pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/1 "2020-12-02T15:13:52Z")

</div>

Using the Fronius binding, I can get the daily solar energy produced, by persisting the data at night. This came from `fronius:powerinverter:mybridge:myinverter:inverterdatachanneldayenergy` channel

However, it seems that the binding doesn’t provide the daily energy consumption or the daily grid energy import/export when a Fronius smart meter is installed (on the grid interconnection point).

I am going to add the code to the binding that gathers data from the Fronius smart meter from /solar\_api/v1/GetMeterRealtimeData.cgi?Scope=System&DataCollection=MeterRealtimeData

It seems that I’ll have to introduce a new Thing for this binding for the meter.

Does anyone have a suggestion if this is currently already achievable?

Edit: I’ve submitted a PR to add support for Fronius Smart Meter [https://github.com/openhab/openhab-addons/pull/9209](https://github.com/openhab/openhab-addons/pull/9209)

It allows me to get the energy drawn from and sent to the grid, if the smart meter is installed on the grid side.

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [December 3, 2020, 2:41am UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/2 "2020-12-03T02:41:37Z")

</div>

I’ve added a new thing called “meter”, to gather the data from the smart meter. It returns a lot of data, but the two things I’m interested in are the total energy consumed and produced (from the perspective of the meter - so the interpretation of this value depends on where the meter is installed, whether it’s on the grid side, or on the load side.)

So here’s the thing/items as shown in PaperUI:

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/4/7/47936f9ce4fbb69182a5bae499dc57021afd76cc.png)

So “Energy real sum consumed” is just the total grid import that we pay for, and the “Energy real sum produced” is the total grid export.

The total household energy consumption would be calculated from “Energy generated overall” (the `inverterdatachanneltotal` channel from the inverter) plus “energy real sum consumed” minus “energy real sum produced” - assuming that the meter is installed on the grid side.

To calculate the daily usage, one must take a snapshot of the values daily, subtracted from the previous day’s snapshot. This could probably be done using cron + persistence, I have yet to write the rule.

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [December 3, 2020, 4:22am UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/3 "2020-12-03T04:22:44Z")

</div>

I’ve added more channels / data to the meter thing:

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/a/9/a9106ad2cb1d69e620f62729fe5c0372ebfba1a5.png)

---

<div class="post-metadata">

**Author:** ![joedirt](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@joedirt](https://community.openhab.org/u/joedirt)\
**Post date:** [January 15, 2021, 11:54pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/4 "2021-01-15T23:54:39Z")

</div>

That’s awesome and is just what I’m looking for. This doesn’t appear to be part of the current binding? Where can I download the binding with support for the smart meter?

Edit…  
Ok so it looks like the meter cannot be added by the ui in oh3 I only have the option to add a bridge or an inverter. I’ll have a look at adding it manually with a txt file.

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [January 16, 2021, 12:18am UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/5 "2021-01-16T00:18:21Z")

</div>

EDIT: The jar in this post has a bug. Do not use it.

It is currently scheduled to be included in OpenHAB 3.1  
If you are using OH 3.0 you can use this jar here. Rename the extension from txt to .jar and drop it into your openhab addons folder. Don’t forget to delete this jar when upgrading to openhab 3.1  
It will not be added to OH 2.4

[org.openhab.binding.fronius-3.0.0-SNAPSHOT.txt](https://community.openhab.org/uploads/short-url/6VX4TFviK76Za1TnmrjhFfbVfAn.txt) (45.1 KB)

---

<div class="post-metadata">

**Author:** ![joedirt](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@joedirt](https://community.openhab.org/u/joedirt)\
**Post date:** [January 16, 2021, 4:51pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/6 "2021-01-16T16:51:01Z")

</div>

awesome, thanks. Ive installed the new binding after uninstalling the old and I have an error after adding a meter thing using the default device ID of 0.

```yaml
2021-01-17 05:43:42.711 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler tried updating the thing status although the handler was already disposed.
2021-01-17 05:43:42.713 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel enable is linked although the handler was already disposed.
2021-01-17 05:43:42.716 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel location is linked although the handler was already disposed.
2021-01-17 05:43:42.718 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel currentacphase1 is linked although the handler was already disposed.
2021-01-17 05:43:42.720 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel currentacphase2 is linked although the handler was already disposed.
2021-01-17 05:43:42.722 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel currentacphase3 is linked although the handler was already disposed.
2021-01-17 05:43:42.725 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel voltageacphase1 is linked although the handler was already disposed.
2021-01-17 05:43:42.726 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel voltageacphase2 is linked although the handler was already disposed.
2021-01-17 05:43:42.729 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel voltageacphase3 is linked although the handler was already disposed.
2021-01-17 05:43:42.731 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel powerrealphase1 is linked although the handler was already disposed.
2021-01-17 05:43:42.733 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel powerrealphase2 is linked although the handler was already disposed.
2021-01-17 05:43:42.735 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel powerrealphase3 is linked although the handler was already disposed.
2021-01-17 05:43:42.737 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel powerfactorphase1 is linked although the handler was already disposed.
2021-01-17 05:43:42.739 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel powerfactorphase2 is linked although the handler was already disposed.
2021-01-17 05:43:42.742 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel powerfactorphase3 is linked although the handler was already disposed.
2021-01-17 05:43:42.743 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel energyrealsumconsumed is linked although the handler was already disposed.
2021-01-17 05:43:42.746 [WARN] [.core.thing.binding.BaseThingHandler] - Handler FroniusMeterHandler of thing fronius:meter:07caeb9e9f tried checking if channel energyrealsumproduced is linked although the handler was already disposed.

```

in the ui it says…  
**COMMUNICATION\_ERROR**  
Invalid JSON data received

if I change the device id to anything other than 0 it gives the same error’s in the logs but in the ui it says…

**COMMUNICATION\_ERROR**  
Meter 1 does not exist

My meter model is a Smart Meter 63A-1 if that helps.

Also was there a way to get the days energy consumed too?

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [January 16, 2021, 9:02pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/7 "2021-01-16T21:02:32Z")

</div>

use deviceid 0. Try restarting openhab.

---

<div class="post-metadata">

**Author:** ![joedirt](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@joedirt](https://community.openhab.org/u/joedirt)\
**Post date:** [January 16, 2021, 10:20pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/8 "2021-01-16T22:20:50Z")

</div>

Yea did that, even rebooted the rpi and still the same error.

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [January 16, 2021, 10:54pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/9 "2021-01-16T22:54:30Z")

</div>

In the karaf console, type:

```auto
bundle:list -s | grep fronius

```

> [@joedirt](#):
>
> Also was there a way to get the days energy consumed too?

Fronius doesn’t seem to supply this information readily. I created a script to calculate this with the help of persistence.

- I save the two items: SmartMeter\_Energy\_Consumed (from channel energyrealsumconsumed) and SmartMeter\_Energy\_Produced (from energyrealsumproduced) before midnight (23:59)
- In a script/rule I calculate the daily produced and consumed energy whenever the value of the two items change by using `deltaSince` (code in Jython):

```auto
PersistenceExtensions.deltaSince(
        ir.getItem("SmartMeter_Energy_Produced"),
        ZonedDateTime.now().withHour(0).withMinute(0).withSecond(0),
        "influxdb",
    )

```

---

<div class="post-metadata">

**Author:** ![joedirt](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@joedirt](https://community.openhab.org/u/joedirt)\
**Post date:** [January 16, 2021, 11:04pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/10 "2021-01-16T23:04:50Z")

</div>

here’s the output from the console.

```yaml
281 │ Active │ 80 │ 3.0.0.202012240647 │ org.openhab.binding.fronius

```

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [January 16, 2021, 11:29pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/11 "2021-01-16T23:29:31Z")

</div>

I’ll see what can be done to avoid the warnings from happening. However, if you’ve restarted openhab, although not necessary, the new binding with meter thing should work. I’m using the exact same jar / version.

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [January 16, 2021, 11:33pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/12 "2021-01-16T23:33:00Z")

</div>

Can you try [Clear the Cache](https://community.openhab.org/t/clear-the-cache/36424) ?

---

<div class="post-metadata">

**Author:** ![joedirt](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@joedirt](https://community.openhab.org/u/joedirt)\
**Post date:** [January 16, 2021, 11:34pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/13 "2021-01-16T23:34:17Z")

</div>

Yea its weird, the bridge and both inverters are showing as online and im getting info from the channels.  
Do you have any more ideas as to what to try next?

 ![Screen Shot 2021-01-17 at 12.31.40 PM](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/3/8/384089b28c1f21e387205f8ad88d9389473dd2a2.png) ![Screen Shot 2021-01-17 at 12.31.53 PM](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/d/7/d7d8ebadce54f060496c33511917751e1a04bbf6.png)

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [January 16, 2021, 11:39pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/14 "2021-01-16T23:39:58Z")

</div>

Hmm `Invalid JSON data received`.

Please turn on DEBUG level

```auto
log:set DEBUG org.openhab.binding.fronius
log:tail org.openhab.binding.fronius

```

and post the logs. It should show you the actual data returned by the fronius.  
To revert this, just set the level to DEFAULT instead of DEBUG

Also try this on your browser and show me the output please

```auto
http://<froniusip>/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=0&DataCollection=MeterRealtimeData

```

---

<div class="post-metadata">

**Author:** ![joedirt](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@joedirt](https://community.openhab.org/u/joedirt)\
**Post date:** [January 16, 2021, 11:40pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/15 "2021-01-16T23:40:08Z")

</div>

Just cleared the cache without any change

---

<div class="post-metadata">

**Author:** ![joedirt](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@joedirt](https://community.openhab.org/u/joedirt)\
**Post date:** [January 16, 2021, 11:42pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/16 "2021-01-16T23:42:51Z")

</div>

Here’s the browser output, I’ll change the log level now.

```yaml
{
   "Body" : {
      "Data" : {
         "Current_AC_Phase_1" : 6.4429999999999996,
         "Current_AC_Sum" : 6.4429999999999996,
         "Details" : {
            "Manufacturer" : "Fronius",
            "Model" : "Smart Meter 63A-1",
            "Serial" : "20270417"
         },
         "Enable" : 1,
         "EnergyReactive_VArAC_Phase_1_Consumed" : 30390,
         "EnergyReactive_VArAC_Phase_1_Produced" : 1380630,
         "EnergyReactive_VArAC_Sum_Consumed" : 30390,
         "EnergyReactive_VArAC_Sum_Produced" : 1380630,
         "EnergyReal_WAC_Minus_Absolute" : 674069,
         "EnergyReal_WAC_Phase_1_Consumed" : 339054,
         "EnergyReal_WAC_Phase_1_Produced" : 674069,
         "EnergyReal_WAC_Plus_Absolute" : 339054,
         "EnergyReal_WAC_Sum_Consumed" : 339054,
         "EnergyReal_WAC_Sum_Produced" : 674069,
         "Frequency_Phase_Average" : 49.899999999999999,
         "Meter_Location_Current" : 0,
         "PowerApparent_S_Phase_1" : 1561.78,
         "PowerApparent_S_Sum" : 1561.78,
         "PowerFactor_Phase_1" : -0.87,
         "PowerFactor_Sum" : -0.87,
         "PowerReactive_Q_Phase_1" : -303.01999999999998,
         "PowerReactive_Q_Sum" : -303.01999999999998,
         "PowerReal_P_Phase_1" : -1363.8399999999999,
         "PowerReal_P_Sum" : -1363.8399999999999,
         "TimeStamp" : 1610840485,
         "Visible" : 1,
         "Voltage_AC_Phase_1" : 242.40000000000001
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DeviceClass" : "Meter",
         "DeviceId" : "0",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:41:26+13:00"
   }
}

```

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [January 16, 2021, 11:47pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/17 "2021-01-16T23:47:04Z")

</div>

Thanks. I understand the problem now. The binding was tested with a 3 phase system. I’ll have to make some changes to support a 1 phase system as well. For the time being, this won’t work for you. I’ll post an update here to let you know when it has been updated, probably in a day or two.

---

<div class="post-metadata">

**Author:** ![joedirt](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@joedirt](https://community.openhab.org/u/joedirt)\
**Post date:** [January 16, 2021, 11:49pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/18 "2021-01-16T23:49:31Z")

</div>

And the log file.

> [@jimtng](#):
>
> `log:tail org.openhab.binding.fronius`

```yaml
12:45:57.937 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachannelpac with state 2232.0 (ValueUnit)
12:45:57.941 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneldayenergy with state 3.1463 (ValueUnit)
12:45:57.954 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneltotal with state 0.525917 (ValueUnit)
12:46:08.021 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=0&DataCollection=MeterRealtimeData
12:46:09.187 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "Current_AC_Phase_1" : 12.654,
         "Current_AC_Sum" : 12.654,
         "Details" : {
            "Manufacturer" : "Fronius",
            "Model" : "Smart Meter 63A-1",
            "Serial" : "20270417"
         },
         "Enable" : 1,
         "EnergyReactive_VArAC_Phase_1_Consumed" : 30390,
         "EnergyReactive_VArAC_Phase_1_Produced" : 1380850,
         "EnergyReactive_VArAC_Sum_Consumed" : 30390,
         "EnergyReactive_VArAC_Sum_Produced" : 1380850,
         "EnergyReal_WAC_Minus_Absolute" : 674256,
         "EnergyReal_WAC_Phase_1_Consumed" : 339054,
         "EnergyReal_WAC_Phase_1_Produced" : 674256,
         "EnergyReal_WAC_Plus_Absolute" : 339054,
         "EnergyReal_WAC_Sum_Consumed" : 339054,
         "EnergyReal_WAC_Sum_Produced" : 674256,
         "Frequency_Phase_Average" : 49.899999999999999,
         "Meter_Location_Current" : 0,
         "PowerApparent_S_Phase_1" : 3074.9200000000001,
         "PowerApparent_S_Sum" : 3074.9200000000001,
         "PowerFactor_Phase_1" : -0.96999999999999997,
         "PowerFactor_Sum" : -0.96999999999999997,
         "PowerReactive_Q_Phase_1" : -286.25,
         "PowerReactive_Q_Sum" : -286.25,
         "PowerReal_P_Phase_1" : -2990.7199999999998,
         "PowerReal_P_Sum" : -2990.7199999999998,
         "TimeStamp" : 1610840767,
         "Visible" : 1,
         "Voltage_AC_Phase_1" : 243
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DeviceClass" : "Meter",
         "DeviceId" : "0",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:07+13:00"
   }
}

12:46:09.195 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Error running fronius request: Invalid JSON data received
12:46:09.200 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData
12:46:10.420 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "DAY_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 4674
         },
         "DeviceStatus" : {
            "ErrorCode" : 0,
            "LEDColor" : 2,
            "LEDState" : 0,
            "MgmtTimerRemainingTime" : -1,
            "StateToReset" : false,
            "StatusCode" : 7
         },
         "FAC" : {
            "Unit" : "Hz",
            "Value" : 49.939999999999998
         },
         "IAC" : {
            "Unit" : "A",
            "Value" : 15
         },
         "IDC" : {
            "Unit" : "A",
            "Value" : 13.789999999999999
         },
         "PAC" : {
            "Unit" : "W",
            "Value" : 3651
         },
         "TOTAL_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 677268
         },
         "UAC" : {
            "Unit" : "V",
            "Value" : 243.59999999999999
         },
         "UDC" : {
            "Unit" : "V",
            "Value" : 274.10000000000002
         },
         "YEAR_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 443269.5
         }
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DataCollection" : "CommonInverterData",
         "DeviceClass" : "Inverter",
         "DeviceId" : "1",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:08+13:00"
   }
}

12:46:10.438 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetPowerFlowRealtimeData.fcgi
12:46:10.592 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 76,
               "E_Day" : 4674,
               "E_Total" : 677266,
               "E_Year" : 443269.5,
               "P" : 3651
            },
            "2" : {
               "DT" : 76,
               "E_Day" : 3152.699951171875,
               "E_Total" : 525924,
               "E_Year" : 348369.90625,
               "P" : 2246
            }
         },
         "Site" : {
            "E_Day" : 7826.699951171875,
            "E_Total" : 1203190,
            "E_Year" : 791639.40625,
            "Meter_Location" : "grid",
            "Mode" : "meter",
            "P_Akku" : null,
            "P_Grid" : -2990.7199999999998,
            "P_Load" : -2906.2800000000002,
            "P_PV" : 5897,
            "rel_Autonomy" : 100,
            "rel_SelfConsumption" : 49.28404273359336
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:08+13:00"
   }
}

12:46:10.600 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachannelpac with state 3651.0 (ValueUnit)
12:46:10.605 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneldayenergy with state 4.674 (ValueUnit)
12:46:10.627 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneltotal with state 0.677268 (ValueUnit)
12:46:10.649 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel powerflowchannelpgrid with state -2990.72 (Double)
12:46:10.655 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel powerflowchannelpload with state -2906.28 (Double)
12:46:10.662 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=2&DataCollection=CommonInverterData
12:46:11.711 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "DAY_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 3155.1999999999998
         },
         "DeviceStatus" : {
            "ErrorCode" : 0,
            "LEDColor" : 2,
            "LEDState" : 0,
            "MgmtTimerRemainingTime" : -1,
            "StateToReset" : false,
            "StatusCode" : 7
         },
         "FAC" : {
            "Unit" : "Hz",
            "Value" : 49.93
         },
         "IAC" : {
            "Unit" : "A",
            "Value" : 9.1199999999999992
         },
         "IDC" : {
            "Unit" : "A",
            "Value" : 6.0300000000000002
         },
         "PAC" : {
            "Unit" : "W",
            "Value" : 2214
         },
         "TOTAL_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 525926.06000000006
         },
         "UAC" : {
            "Unit" : "V",
            "Value" : 243.19999999999999
         },
         "UDC" : {
            "Unit" : "V",
            "Value" : 374.19999999999999
         },
         "YEAR_ENERGY" : {
            "Unit" : "Wh",
            "Value" : 348372.40999999997
         }
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DataCollection" : "CommonInverterData",
         "DeviceClass" : "Inverter",
         "DeviceId" : "2",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:10+13:00"
   }
}

12:46:11.720 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetPowerFlowRealtimeData.fcgi
12:46:11.771 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 76,
               "E_Day" : 4674,
               "E_Total" : 677268,
               "E_Year" : 443269.5,
               "P" : 3651
            },
            "2" : {
               "DT" : 76,
               "E_Day" : 3154,
               "E_Total" : 525925,
               "E_Year" : 348371.21875,
               "P" : 2240
            }
         },
         "Site" : {
            "E_Day" : 7828,
            "E_Total" : 1203193,
            "E_Year" : 791640.71875,
            "Meter_Location" : "grid",
            "Mode" : "meter",
            "P_Akku" : null,
            "P_Grid" : -2956.73,
            "P_Load" : -2934.27,
            "P_PV" : 5891,
            "rel_Autonomy" : 100,
            "rel_SelfConsumption" : 49.80937022576812
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:10+13:00"
   }
}

12:46:11.788 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachannelpac with state 2214.0 (ValueUnit)
12:46:11.796 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneldayenergy with state 3.1552 (ValueUnit)
12:46:11.809 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - Update channel inverterdatachanneltotal with state 0.5259260600000001 (ValueUnit)
12:46:21.868 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - URL = http://192.168.178.161/solar_api/v1/GetMeterRealtimeData.cgi?Scope=Device&DeviceId=0&DataCollection=MeterRealtimeData
12:46:23.262 [DEBUG] [ernal.handler.FroniusBaseThingHandler] - aqiResponse = {
   "Body" : {
      "Data" : {
         "Current_AC_Phase_1" : 12.922000000000001,
         "Current_AC_Sum" : 12.922000000000001,
         "Details" : {
            "Manufacturer" : "Fronius",
            "Model" : "Smart Meter 63A-1",
            "Serial" : "20270417"
         },
         "Enable" : 1,
         "EnergyReactive_VArAC_Phase_1_Consumed" : 30390,
         "EnergyReactive_VArAC_Phase_1_Produced" : 1380870,
         "EnergyReactive_VArAC_Sum_Consumed" : 30390,
         "EnergyReactive_VArAC_Sum_Produced" : 1380870,
         "EnergyReal_WAC_Minus_Absolute" : 674267,
         "EnergyReal_WAC_Phase_1_Consumed" : 339054,
         "EnergyReal_WAC_Phase_1_Produced" : 674267,
         "EnergyReal_WAC_Plus_Absolute" : 339054,
         "EnergyReal_WAC_Sum_Consumed" : 339054,
         "EnergyReal_WAC_Sum_Produced" : 674267,
         "Frequency_Phase_Average" : 49.899999999999999,
         "Meter_Location_Current" : 0,
         "PowerApparent_S_Phase_1" : 3143.9200000000001,
         "PowerApparent_S_Sum" : 3143.9200000000001,
         "PowerFactor_Phase_1" : -0.96999999999999997,
         "PowerFactor_Sum" : -0.96999999999999997,
         "PowerReactive_Q_Phase_1" : -284.42000000000002,
         "PowerReactive_Q_Sum" : -284.42000000000002,
         "PowerReal_P_Phase_1" : -3065.8699999999999,
         "PowerReal_P_Sum" : -3065.8699999999999,
         "TimeStamp" : 1610840781,
         "Visible" : 1,
         "Voltage_AC_Phase_1" : 243.30000000000001
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DeviceClass" : "Meter",
         "DeviceId" : "0",
         "Scope" : "Device"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2021-01-17T12:46:21+13:00"
   }
}

```

---

<div class="post-metadata">

**Author:** ![joedirt](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/ec9cab/32.png) [@joedirt](https://community.openhab.org/u/joedirt)\
**Post date:** [January 16, 2021, 11:49pm UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/19 "2021-01-16T23:49:52Z")

</div>

Awesome thanks!

---

<div class="post-metadata">

**Author:** ![jimtng](https://community.openhab.org/user_avatar/community.openhab.org/jimtng/32/98543_2.png) [@jimtng](https://community.openhab.org/u/jimtng)\
**Post date:** [January 18, 2021, 1:54am UTC](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332/20 "2021-01-18T01:54:39Z")

</div>

@joedirt Out of curiosity, what’s your inverter model please?

Please try the following jar (rename .txt to .jar, delete the old 3.0.0-SNAPSHOT jar)  
[org.openhab.binding.fronius-3.1.0-SNAPSHOT.txt](https://community.openhab.org/uploads/short-url/1kN5ldvjI5Cl4WXO4BKBpVddT2d.txt) (45.1 KB)

```auto
openhab> bundle:list -s | grep fronius
266 │ Active │ 80 │ 3.1.0.202101180259 │ org.openhab.binding.fronius

```

[Next page](https://community.openhab.org/t/fronius-how-to-get-the-daily-total-energy-consumption-and-grid-import-export/109332.md?page=2)
