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.

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
  • Add your Pixometer credentials in json payload format into your secrets.yaml, should look like: pixometer_credentials: '{ "username" : "[email protected]", "password": "XXXXXXXXXXXXX" }'
  • Navigate to https://pixometer.io/portal/#/login to login on the API website
  • Navigate to https://pixometer.io/api/v1/meters/ to get your meter_id values
  • Repeat below rest readings configuration for every meter you’d like to use adding the correct meter_id into the rest resource url


  - platform: rest
    name: Pixometer Token
    method: POST
    resource: https://pixometer.io/api/v1/access-token/
    payload: !secret pixometer_credentials
    scan_interval: 3600
    value_template: '{{"Bearer "+ value_json.access_token}}'
      Content-Type: application/json
  - platform: rest
    name: Pixometer Electricity
    resource: https://pixometer.io/api/v1/readings/?meter_id=XXXXXXXX&o=-created
        Authorization: '{{states("sensor.pixometer_token")}}'
      - results
    value_template: "{{ value_json.results[0].value }}"
  - platform: template
        value_template: "{{ states.sensor.pixometer_electricity.attributes.results[0].value }}"
        device_class: energy
        unit_of_measurement: "kWh"

    source: sensor.electricity_pixometer
    cycle: daily
    net_consumption: true

Updated my post to automatically fetch the access token with a separate rest sensor ‘Pixometer Token’, as this access token has limited time to live.