Integration guide

Home Assistant integration

Connect your Axle account to Home Assistant to see upcoming grid events and plan around them from your smart home dashboard.

Choose how to connect

There are three ways to connect Axle to Home Assistant.

  • PredBat

    If PredBat manages your battery, Axle is built in. Add your Axle API key to your apps.yaml.
    PredBat docs →
  • HACS

    A community integration by Dean Hall with setup in the Home Assistant UI. No YAML needed.
    View on GitHub →
  • REST sensor

    Add a sensor to your configuration.yaml by following the steps below.
    Jump to setup →

Step 1: Get your token

Generate a token in your Axle account. It lets Home Assistant read your grid events securely.

  1. Log in and open Account, then Settings.
  2. Open Home Assistant. It's only there in Events Only mode.
  3. Select Generate Token and copy the token.
Go to Home Assistant settings →
Keep your token private. Anyone with it can read your grid events.

Step 2: Add the sensor

Add this sensor to your Home Assistant configuration.yaml. It checks Axle for upcoming grid events every 10 minutes.

Replace YOUR_TOKEN_HERE with your token. Keep the Bearer prefix and the quotes around the whole value.

yaml
sensor:
  - platform: rest
    name: Axle Event
    resource: https://api.axle.energy/vpp/home-assistant/event
    scan_interval: 600
    headers:
      Authorization: "Bearer YOUR_TOKEN_HERE"
    json_attributes:
      - start_time
      - end_time
      - import_export
      - updated_at
    value_template: >-
      {% if value_json is defined and value_json.start_time is defined %}
        {{ value_json.start_time }}
      {% else %}
        {{ none }}
      {% endif %}

Restart Home Assistant for the change to take effect. To check the sensor is working, open Developer Tools > States and search for sensor.axle_event.

Step 3: Use the sensor

sensor.axle_event has these attributes. Use them in automations, scripts or dashboard cards. When no event is scheduled, the sensor's state is empty.

AttributeTypeDescription
start_timeISO 8601 datetimeWhen the next grid event starts
end_timeISO 8601 datetimeWhen the grid event ends
import_exportstring: "import" | "export"Whether to import from or export to the grid
updated_atISO 8601 datetimeWhen the event data was last updated
Beta: these fields may change. We'll email you before any breaking change. To ask for another field, email us.

Frequently asked questions

No. Axle runs your battery's grid events without it. The integration is for people who want to see events in their own dashboards or build automations around them.

Related guides

Ready to get paid for your battery?

Join today and get paid from your next grid event. At least £10/month guaranteed.

Free to join · Takes 5 minutes