@mathewryan wrote:
I’m trying to display power consumption and generation values from a power usage system called Reposit (repositpower.com) which I already have installed. I’ve managed to interrogate the iOS app and I have found the API URL. The output is displayed within a browser (following authentication) as:
{ "data": { "battery": { "message": null, "state": "ONLINE", "val": 0.0 }, "battery_soc": { "val": 0 }, "display_scale": { "max": 5.139999866485596, "min": 0 }, "grid": { "message": null, "state": "ONLINE", "val": 0.09839528143469448 }, "house": { "message": null, "state": "ONLINE", "val": 4.794253064432299 }, "solar": { "message": null, "state": "ONLINE", "val": -4.695857782997605 } } }
I’m running the latest version of hass.io on my raspberry pi and I have so far put together the following code, based off the description given here (https://www.home-assistant.io/integrations/rest/):
# Reposit - platform: rest name: reposit resource: https://urlforapi username: username password: password authentication: basic json_attributes: - data value_template: 'OK' scan_interval: 5 - platform: template sensors: reposit_grid: value_template: '{{ states.sensor.reposit.attributes["data"]["grid"]["val"] }}' device_class: power unit_of_measurement: 'kW' reposit_house: value_template: '{{ states.sensor.reposit.attributes["data"]["house"]["val"] }}' device_class: power unit_of_measurement: kW reposit_solar: value_template: '{{ states.sensor.reposit.attributes["data"]["solar"]["val"] }}' device_class: power unit_of_measurement: 'kW'
I’m guessing that I’ve made a simple mistake but if anyone can nudge me in the right direction, it would be greatly appreciated.
Thanks,
Mat
Posts: 1
Participants: 1