Efergy / Energyhive - JSON Transformation throws exception

After few years of just reading my power instant values from the Efergy system with Energyhive account (thanks to this community page!), I decided to go a bit deeper in my energy consumption overview.

Unfortunately, doing calculations from instant values inside Openhab, using daily rules, is not working as well as desired, so the simple way is to get the desired values directly from the Energyhive API (which I could not find before).

Here I found interesting info for the API, to get the desired values: http://napi.hbcontent.com/document/index.php

Here some examples that allow me to simply read monthly energy consumption and monthly cost.

Items

String EnergyMonthHouse "Energia mese Casa [%s kWh]" <myicon> (G_EnergyM) { http="<[http://www.energyhive.com/mobile_proxy/getEnergy?token=XXXXXXXXXXX&period=month&offset=-60:60000:JSONPATH($.sum)]"}
String EnergyCostMonthHouse "Costo Energia mese Casa [%s EUR]" <myicon> (G_EnergyEUR) { http="<[http://www.energyhive.com/mobile_proxy/getCost?token=XXXXXXXXXXX&period=month&offset=-60:60000:JSONPATH($.sum)]"}

The period can be simply changed by using “day”, “week”, “year” instead of “month”.
Change the “getEnergy” or “getCost” with what you like in the API linked page to get different “channels”.
Obviously use your personal token instead of “XXXXX”.
I am not using transformation files or rules on these items, but see for yourself if you need them.
I hope it works for you too! :grinning: