Get meter history
The Get meter history action reads the session log the Peblar charger’s certified meter keeps for itself. Every record holds the meter reading at both ends of a session and the token the session was authorized with, so you can tell whose session it was.
The energy sensors cannot tell you that. Use this action to settle up with a neighbor who charges on their own key fob, or to hand your employer a record per session of a lease car.
The meter records a session whether or not a token was presented. A session without one comes back with uid: null.
Try it yourself
Ready to test this? Open Settings > Tools > Actions, search for this action, fill in the fields, and select Perform action. You see what happens on your actual entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without writing a line of YAML.
Using this action from the user interface
If you prefer building automations and scripts visually, Home Assistant walks you through this action step by step. You pick what to target, tweak a few options, and save. No YAML knowledge required.
To read the meter history from an automation or a script:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create to start a new one.
- In the Then do section, select Add action.
- From the search box, search for and select Peblar: Get meter history.
- Under Peblar EV charger, select the Peblar charger to read from.
- Optionally set After and Before to narrow the period.
- In the Response variable field, enter a name to store the data in, such as
meter. - Select Save.
Options in the UI
Using this action in YAML
If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required. For how an automation or a script is built in YAML, refer to Automations in YAML and Scripts.
In YAML, refer to this action as peblar.get_meter_history. A basic example looks like this:
action: peblar.get_meter_history
data:
config_entry_id: "01234567890abcdef01234567890abcd"
after: "2026-01-01 00:00:00"
before: "2026-02-01 00:00:00"
response_variable: meter
Options in YAML
The ID of the Peblar charger config entry to read the meter history from.
Only return sessions that started at or after this moment. A moment written without a timezone is read in the timezone Home Assistant runs in.
Response data
The action returns the charger’s own verdict on the log as corrupted, and the sessions themselves under sessions:
corrupted: false
sessions:
- session_number: 41
uid: "04A1B2C3D4E5F6"
start_time: "2026-01-22T12:00:00+00:00"
end_time: "2026-01-22T19:00:00+00:00"
start_energy_kwh: 1401.0
end_energy_kwh: 1408.5
energy_kwh: 7.5
checksum: 3613161996
corrupted: false
- session_number: 42
uid: null
start_time: "2026-01-23T12:00:00+00:00"
end_time: null
start_energy_kwh: 1408.5
end_energy_kwh: null
energy_kwh: null
checksum: 992513408
corrupted: false
The session that is still running has no end yet, so its end time, closing meter reading, and energy are all empty.
Good to know
- Only administrators can run this action.
- The charger keeps this log itself, so it reaches back further than Home Assistant does, and a database purge leaves it alone.
- Times come back in UTC, as text. To show them in your own time zone, convert them first:
{{ session.start_time | as_datetime | as_local }}. - A record that no longer matches its own checksum is marked
corrupted. Do not bill on a corrupted record. If the charger returns no checksum outcome for a session,corruptedisnull, nottrueorfalse.
More examples
Real scenarios where this action shows up in automations and scripts. Copy any example and adapt it to your setup. In the visual editor, select the UI options listed in the example or paste the YAML code.
You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the visual automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.
Automation: Send the total energy charged with one token
Add up the energy of every finished session that used your neighbor’s key fob, so you know what to invoice them for.
YAML example for totalling one token
triggers:
- trigger: time
at: "09:00:00"
actions:
- action: peblar.get_meter_history
data:
config_entry_id: "01234567890abcdef01234567890abcd"
response_variable: meter
- action: notify.mobile_app_your_phone
data:
title: "Peblar charging by the neighbor"
message: >
{{ meter.sessions | selectattr('uid', 'eq', '04F6E5D4C3B2A1')
| selectattr('energy_kwh', 'is_number')
| map(attribute='energy_kwh') | sum | round(2) }} kWh so far.
Still stuck?
To test the action on its own, run it in the automation editor with Run action, and check the message that it shows. To see what the action did when the automation ran, open the trace of that run. For details, refer to Testing automations. For common problems and their solutions, refer to Troubleshooting automations.
If that doesn’t help, the Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the action you’re calling and what you expected to happen, or share on our subreddit /r/homeassistant.
AI assistants like ChatGPT or Claude can also explain actions or suggest the right one when you describe what you want in plain language.