I am finally migrating my Efergy / Energyhive system to OH3.2.0 (manual installation of Build #2546).
Here my setup in short (not shown here: my second Efergy account and period channels “day” and “week”; offset is related to my timezone).
I am using a “hybrid” approach: Things in UI and Items in config file.
Things (HTTP Binding):
UID: http:url:HTTP_ENERGIA
label: HTTP Energia
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: http://www.energyhive.com/mobile_proxy
delay: 0
stateMethod: GET
refresh: 10
commandMethod: GET
contentType: text/plain
timeout: 60000
bufferSize: 2048
location: Home
channels:
- id: PowerHouse
channelTypeUID: http:string
label: Potenza assorbita Casa
description: null
configuration:
mode: READONLY
unit: W
stateExtension: /getCurrentValuesSummary?token=XXXXXXXXXXXXXXXXXXX
stateTransformation: JS:efergy.js
- id: EnergyMonthHouse
channelTypeUID: http:string
label: Energia mese Casa
description: null
configuration:
mode: READONLY
stateExtension: /getEnergy?token=XXXXXXXXXXXXXXXXXXX&period=month&offset=-60
stateTransformation: JSONPATH:$.sum
- id: EnergyCostMonthHouse
channelTypeUID: http:string
label: Costo Energia mese Casa
description: null
configuration:
mode: READONLY
unit: kWh
stateExtension: /getCost?token=XXXXXXXXXXXXXXXXXXX&period=month&offset=-60
stateTransformation: JSONPATH:$.sum
In the file efergy.js in “transform” folder:
JSON.parse(input)[0].data[0][Object.keys(JSON.parse(input)[0].data[0])[0]];
In Items file:
Number PowerHouse "Potenza assorbita Casa [%d W]" <energy> (G_Power, G_House) ["Point_Measurement","Property_Power"] {channel="http:url:HTTP_ENERGIA:PowerHouse"}
Number EnergyMonthHouse "Energia mese Casa [%.1f kWh]" <qualityofservice> (G_Power, G_House) ["Point_Measurement","Property_Power"] {channel="http:url:HTTP_ENERGIA:EnergyMonthHouse"}
Number EnergyCostMonthHouse "Costo Energia mese Casa [%.2f €]" <price> (G_Power,G_House) ["Point_Measurement","Property_Power"] {channel="http:url:HTTP_ENERGIA:EnergyCostMonthHouse"}
Works fine