Nissan Leaf Component(s)/Platform

Unfortunately setting the log level to Info didn’t yield any more information from the log.

Hello!
This log is there to ensure we see the version no matter the log level. It is not a real error.

I can reduce the severity of this log since I did not really update the version with each changes anyway

So if I don’t get any other messages in the log. Does that mean the add-on is functioning correctly?

The best way to see if it is working correctly is to try it by refreshing battery information, starting climate, etc :slight_smile:

I would not assume that it is correctly working if there is no apparent issues in the logs.

I did the change, there should be a new docker image available soon

Thanks. I uninstalled and reinstalled and it’s working now with same config as before. Thanks buddy

1 Like

Thanks to @EtienneMD, his addon configuration is now part of the leaf2mqtt repository.

Home Assistant add-on

Click the icon below to add this repository to your Home Assistant instance or follow the procedure highlighted on the Home Assistant website.

Install leaf2mqtt add-on repo.

This seems promising! How do you configure it once added as an add-on?

Everything is configured on the add-on configuration page.

More info on configuration options on the project repo.

1 Like

Thanks—had to uninstall/reinstall. It works! Though, like previous versions, it still doesn’t seem to update the battery as reliably as the climate/location. Might post some logs later after a little more observation.

I’m really pleased for the possibility to integrate our car into Home Assistant, via Leaf2Mqtt. I went through this post and learned that @Sriracha has been really kind and kept updating the addon for the rest of us. Amazing!

I do need some help however with extracting the stats values. I don’t seem to get anything out - I’m checking with MQTT explorer as well as the listener tool in Home Assistant. It would be interesting to get the kilometersPerKwh and the kwhUsed etc.

I did race an issue - stats - help needed · Issue #32 · yp87/leaf2mqtt · GitHub, but perhaps it’s only something simple I’m missing. I’ve noticed there is a tripHistory and therefor tried swopping stats to tripHistory to alter the dates, but no luck.

Could someone help please…

Hi

I have nissan Leaf 2014 and I could not add it on my home assistant dashboard.
the config file looks like:

nissan_leaf:

username: XXXX

password: XXXXX

region: NE

update_interval:

hours: 1

update_interval_charging:

minutes: 15

update_interval_climate:

minutes: 5

force_miles: false

sensor:

  • platform: template

    sensors:

    leaf_state:

    value_template: "Ladd: {{ states('binary_sensor.leaf_charging_status') }}"
    

    leaf_range_ac:

    value_template: "A/C räckvid: {{ states('sensor.leaf_range_ac') }}"
    

    leaf_range:

    value_template: "räckvid: {{ states('sensor.leaf_range') }}"
    

    leaf_battery:

    unit_of_measurement: '%'
    
    value_template: "{{ states('sensor.leaf_charge') }}"
    
    icon_template: "{%- if states.sensor.leaf_charge.state >= '95' %}mdi:battery{%- elif states.sensor.leaf1mich_charge.state == '100' %}mdi:battery{%- elif states.sensor.leaf1mich_charge.state <= '15' %}mdi:battery-outline{% else %}mdi:battery-{{(states.sensor.leaf1mich_charge.state|float / 10)|round*10}}{%- endif %}"
    

what should I write on " states.sensor.leaf1mich_charge.state " instead of Leaf1Mich ? where can I know the nickname ?

what is the wrong with my code ? I am new at home assistant and i am very thankfull if you can explain step by step / thanks

I’ve just installed yp87’s version for my new leaf, but I’m wondering how people deal with the 12v battery as I understand that it runs flat when you are not using the car.

Currently my update interval is set to every 24 hours, but I’d like to change that to 1 hour.

  • Can I run a script to disable the updates during vacation?
  • If I would run flat, how hard (or simple) would it be to recharge the 12V battery? Does the car start without?
  • Can I monitor the 12v battery through mqtt?

Other things to do when the car is sometimes not used for multiple days (or more)?

For the last couple of years I have had an update interval of about 10 minutes and have never had a problem with the 12v battery. If I remember correctly, the drive battery will recharge the 12v battery so long as it’s not plugged in. So if you are leaving the car at home while you are on vacation, you would be best leaving the car unplugged.

If it were to go flat then it would be a pain, as the car cannot start. I guess your garage or breakdown service could recharge the battery enough to get you started, just as with a normal car.

so as long as my main battery has let’s say 5%+ and the car is not plugged in, I should not be worried about my 12v battery. That’s good to know :slight_smile:

now I should only figure out how to disable this integration remotely. I can’t access my yaml file remotely. Running HA in docker

Do you need to disable the integration, or just change the update interval?

I’m not sure about the mqtt variant of this, but using the integration that works directly in HA, the documentation includes information on how to request an adhoc update. Perhaps you could set the update interval to be very infrequent and then write an automation in HA which does more frequent polling for updates. You could either switch that automation off through the UI (perhaps remotely using Nabu Casa), or implement a variable/helper that tells the whole system when you are on vacation.

1 Like

When I stayed in due to COVID self isolation, I think after something like 14 days, the car automatically stop responding to Nissan server polling. The integration will only throw up an error in the logs so not noticeable during vacation, but very noticeable when I’m restarting HA to tweak settings.

So I wouldn’t worry about it.

But don’t let the 12v run flat. The car electronics require the 12v to “jump start” the main traction battery. You can buy the cheapest power-bank car jump start kit. It only needs 12v and doesn’t require normal ICE car level of jump start current, so if it does go flat, just connect this up and it will start. Once the main battery is powered up, it will recharge the 12v.

Hi, I am being told that the add on is not compatible with processor or OS?

Are there specific requirements?

@newbuilder22, the addon only support AMD64 and ARM64.

Does anyone have a nice Hvac example for my lovelace interface?

Hi
I have managed to install Leaf2mqtt and install mosquitto. The logs show it is logging in and I have added the integration of the battery received, battery updated and battery level. But they are all showing as unavailable.

I will have missed something but wondered if someone could help. I ahve been using HA for about 1 month so all new!