Pixometer integration

Would love to get pixometer data integrated in Home Assistant. As I don’t have enough python experience myself, I was wondering if anyone would have plans to do so? The free app let’s you easily scan and recognize meter reading and upload it into your pixometer account.
I know openHAB has this data integrated, so probably the openHAB approach and code could be used to make the same in Home Assistant?

Will also look forward into this topic to learn develop my own first custom integration, but for sure all assistant would be welcome :wink:

It seems according to the openhab page that it’s an API.
So a rest sensor could probably work

Hi, thx for your input! yes indeed, after some searching on openHab forum, found some pointer to the API.
https://pixometer.io/api/v1/

Will search a bit urther to get authentication config with rest sensor.

Found some time to look into this, if anyone interested, see below. Feel free to suggest improvements, still trying out myself…

  • Install Pixometer app to easily scan your meter reading with smartphone camera

  • Navigate to https://pixometer.io/api/v1/access-token/ and enter Pixometer credentials to generate a Bearer access token

  • Add this Bearer token into your secret.yaml, should look like: pixometer_bearer: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Navigate to https://pixometer.io/api/v1/meters/ to get your meter_id values

  • Repeat below rest configuration for every meter you’d like to use adding the correct meter_id into the rest resource url

configuration.yaml:

sensor:
  - platform: rest
    name: Pixometer Electricity
    resource: https://pixometer.io/api/v1/readings/?meter_id=XXXXXXXX&o=-created
    headers:
        Authorization: !secret pixometer_bearer
    json_attributes:
      - results
    value_template: "{{ value_json.results[0].value }}"
  - platform: template
    sensors:
      electricity_pixometer:
        value_template: "{{ states.sensor.pixometer_electricity.attributes.results[0].value }}"
        device_class: energy
        unit_of_measurement: "kWh"


utility_meter:
  energy:
    source: sensor.electricity_pixometer
    cycle: daily
    net_consumption: true