Skip to content

A Home Assistant integration to receive live data sent from the LeafSpy app

License

Notifications You must be signed in to change notification settings

jesserockz/ha-leafspy

Repository files navigation

LeafSpy integration for Home Assistant

GitHub Release GitHub Activity License

hacs Project Maintenance

This Home Assistant component enables you to get information from your Nissan Leaf car into Home Assistant by integrating with the LeafSpy Android or iOS apps.

Plug a Bluetooth OBD2 adapter (like this one) into your Nissan Leaf. Open up LeafSpy and pair your phone with the adapter. It will then read information from your car. This integration will allow your phone to submit that info to Home Assistant.

Installation and configuration

  1. Install HACS.
  2. Add this to HACS as a custom repository by pressing this button and pressing "Download" in the bottom right.

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

  1. Restart Home Assistant
  2. Add the Leaf Spy integration by pressing this button.

Open your Home Assistant instance and start setting up a new integration.

  1. Configure your LeafSpy app settings using the information below, which will also be displayed on screen. If you don't have the app in front of you, copy down the password. The generated password will only be shown this once; if you don't copy it down, you'll have to uninstall the integration, restart, and reinstall. Open the LeafSpy app, go to Menu -> Settings.
  • In the Units section:
    • Choose °C
    • Convert Outside Temperature: On
    • CAN Odometer in Miles: On (if you see the option and if your car odometer displays in miles)
  • In the Server section:
    • Enable: On
    • Send Interval: Whatever frequency you prefer
    • PW: <Generated and displayed during setup>
    • Http:// or Https://: Depends on your Home Assistant installation
    • URL: <Displayed during setup>
      • (Do not include the http or https prefix in the URL field.)

Entities

See LeafSpy manual for more details on the data that the app sends.

Device tracker

Entity ID Note
device_tracker.leaf Tracks latitude, longitude, GPS accuracy, and battery level

Binary sensor

Entity ID
binary_sensor.leaf_power

Sensors

Entity ID Unit reported by LeafSpy Note
sensor.leaf_ambient_temperature °C (You must set this in the LeafSpy app; see instructions above.) Unit adjustable in HA UI.
sensor.leaf_battery_capacity Ah
sensor.leaf_battery_conductance % Referred to as Hx in the LeafSpy manual.
sensor.leaf_battery_current A
sensor.leaf_battery_health %
sensor.leaf_battery_state_of_charge %
sensor.leaf_battery_stat_of_charge_gids Gids
sensor.leaf_battery_temperature °C (You must set this in the LeafSpy app; see instructions above.) Unit adjustable in HA UI.
sensor.leaf_battery_voltage V
sensor.leaf_charge_mode ---
sensor.leaf_charge_power W Not very accurate. For example, when charging via level 2 charging, it just guesses 6,000 W.
sensor.leaf_elevation m Unit adjustable in HA UI
sensor.leaf_front_wiper_status --- To get this information you may need to make a custom screen in LeafSpy to read wiper status.
sensor.leaf_motor_speed RPM
sensor.leaf_odometer km (You must indicate in LeafSpy if your displayed car odometer is in mi; see instructions above.) Unit later adjustable in HA UI.
sensor.leaf_phone_battery %
sensor.leaf_plug_status --- Reports "Not plugged", "Partial Plugged", or "Plugged."
sensor.leaf_sequence_number --- A number that increments with each report from LeafSpy.
sensor.leaf_speed km/h Unit adjustable in HA UI.
sensor.leaf_trip_number --- Tracks total number of trips taken.
sensor.leaf_vin --- Car unique identifier.