Free API for real-time MISO grid electricity prices (with a REST sensor + automation)

Disclaimer: this is an API I built with the help of Claude Code. It’s quite early, and I’m posting to find out if it’s useful for the HA community, and looking for interested users to help give me feedback on it.

What it does

If you’re in MISO territory (central US — IL, IN, IA, MI, MN, MO, WI, AR, LA, MS and neighbors),
you can pull the real-time wholesale price for the grid node nearest your house straight into HA.
You give it a lat/lon, it finds the closest actual pricing node and returns the live 5-minute price.

Mildly interesting caveat for nerds (like myself haha): MISO only publishes node locations inside a projected contour-map feed (Lambert Conformal Conic), not as normal coordinates. I got Claude to help me regroup all ~325 nodes to WGS84 lat/lon so the nearest-node lookup just works from a lat/lon, so no need to know a node name first.

The honest caveat (please read before you wire it up)

This is the wholesale nodal price, not your retail rate. It’s the right signal if you’re on a
real-time / hourly plan (Ameren Power Smart Pricing, ComEd hourly, etc.) or you just want to shift
to power-hungry devices (dishwasher, EV, battery, etc) to cheap grid hours. If you’re on a flat rate, it will not change your bill.

REST sensor (runs on the free tier as-is)

Replace the lat/lon with yours (Settings → Areas & Zones → Home shows your coordinates):

sensor:
  - platform: rest
    name: Grid Price
    resource: "https://miso-lmp-api.vercel.app/api/v1/lmp/nearest?lat=41.85&lon=-87.65"
    headers:
      x-api-key: !secret miso_api_key
    value_template: "{{ (value_json.data.lmp | float / 10) | round(2) }}"  # $/MWh -> ¢/kWh
    unit_of_measurement: "¢/kWh"
    json_attributes_path: "$.data"
    json_attributes:
      - mcc   # congestion component
      - mlc   # loss component
    scan_interval: 1800   # 30 min = 48 calls/day, well inside the free 150/day

A 5-minute poll (288/day) would blow the free 150/day quota by mid-afternoon, so the default here is 30 minutes: plenty, since prices don’t swing enough in 5 minutes to change a load-shifting decision.

Example automation: run something only when it’s cheap

automation:
  - alias: "Run dishwasher when grid price is cheap"
    trigger:
      - platform: numeric_state
        entity_id: sensor.grid_price
        below: 3          # ¢/kWh — tune to your market; check a few days of history first
    action:
      - service: switch.turn_on
        target:
          entity_id: switch.dishwasher

Day-ahead prices are live too, so you can plan the whole next day instead of just reacting.

Get a key

curl -X POST https://miso-lmp-api.vercel.app/api/v1/signup \ -H 'Content-Type: application/json' -d '{"email":"[email protected]"}' ​

The key is shown once. Full HA example + Python/JS clients (MIT licensed):

Limits

  • MISO only. no ERCOT/PJM/CAISO or non-US grids. If your lat/lon is outside MISO, it tells you. I’m considering working on a version for CAISO if I ever have the time, but any support in that aspect would be greatly appreciated.
  • Wholesale ≠ retail (see above). Prices may be different though hopefully the general trends are similar.

Greatly appreciate anyone who tries this tool and discovers bugs, or places where it breaks. I am also new to monetizing these sorts of projects, so anyone who are looking to support this project (thank you so much!) but find the prices outside their comfort please leave a comment!