Nissan Leaf Component(s)/Platform


#42

Good points. We should already be able to query home assistant when the value was last updated to get an idea of how stale the data is.

I think my instance is failing because it can’t get the py carwings library before home assistant gives up. It did that to me the first time, but after rebooting it worked. I was going to download and store it locally to see if that fixed it.


#43

nissan

I am installed files from

https://github.com/BenWoodford/home-assistant/tree/nissanleaf

in custom_component folder.

    \HASSIO\config\custom_component\nissan_leaf.py
    \HASSIO\config\custom_component\switch\nissan_leaf.py
    \HASSIO\config\custom_component\sensor\nissan_leaf.py
    \HASSIO\config\custom_component\binary_sensor\nissan_leaf.py

nissan%20component%20

Configuration file

nissan_leaf:
      username: "Nissan Connect username"
      password: "Nissan Connect password"
      nissan_connect: false
      region: 'NE'
      update_interval: 30
      update_interval_charging: 15
      update_interval_climate: 5
      force_miles: true

logger:
  default: critical
  logs:
    homeassistant.components.nissan_leaf: debug
    homeassistant.components.sensor.nissan_leaf: debug
    homeassistant.components.switch.nissan_leaf: debug

#44

@smile Have you put in your username/email and password you use to connect to the Nissan App into the config?


#45

yes i did.
Have you complete guide how to use Nissan leaf custom component. maybe i am missing some thing. i am tried both to put my username and password in configuration.yaml file and in nissan_leaf.py, but same result.

nissan_leaf:
      username: "my nissan Connect username"
      password: "my nissan Connect password"
      nissan_connect: false
      region: 'NE'
      update_interval: 30
      update_interval_charging: 15
      update_interval_climate: 5
      force_miles: true

#46

Sorry mate, I’m quite a noob and it’s not my project, I’ve done my best, Good luck :frowning:


#47

I had some time to find out why my config is failing today.
If I understand the error correctly, it is failing while trying to install the pycryptodome requirement for pycarwings2.

2018-04-03 19:46:59 ERROR (SyncWorker_3) [homeassistant.util.package] Unable to install package https://github.com/BenWoodford/pycarwings2/archive/master.zip#pycarwings: Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-w096xrm2/pycryptodome/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-wcsca0p2-record/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-w096xrm2/pycryptodome/ 2018-04-03 19:46:59 ERROR (MainThread) [homeassistant.requirements] Not initializing nissan_leaf because could not install requirement https://github.com/BenWoodford/pycarwings2/archive/master.zip#pycarwings 2018-04-03 19:46:59 ERROR (MainThread) [homeassistant.setup] Setup failed for nissan_leaf: Could not install all requirements.


#48

Odd isn’t it, I’ve been running HA on an old windows PC and the Leaf element works fine.


#49

What is really odd is that it was working on my HASSIO installation.
I think one of the latest HASSIO updates may have caused the problem. I am also having problems with the fact that all of the historical data has disappeared. I plan to reflash my my Pi’s memory card and restore from backup to see if that fixes it.


#50

It’s likely that HASS.io doesn’t like using direct git links for libraries, which I’ve had to use for now as the author of the library hasn’t pulled my changes in yet.

I run mine straight in docker without HASS.io so haven’t come across these issues.


#51

Please help.

    Setup failed for nissan_leaf: Could not install all requirements.
    00:02 setup.py (ERROR)
    Not initializing nissan_leaf because could not install requirement https://github.com/BenWoodford/pycarwings2/archive/master.zip#pycarwings
    00:02 requirements.py (ERROR)
    Unable to install package https://github.com/BenWoodford/pycarwings2/archive/master.zip#pycarwings: Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fz56baud/pycryptodome/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-buryeidq-record/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-fz56baud/pycryptodome/
    00:02 util/package.py (ERROR)

#52

Please help me.

Setup failed for nissan_leaf: Could not install all requirements.
00:02 setup.py (ERROR)
Not initializing nissan_leaf because could not install requirement https://github.com/BenWoodford/pycarwings2/archive/master.zip#pycarwings
00:02 requirements.py (ERROR)
Unable to install package https://github.com/BenWoodford/pycarwings2/archive/master.zip#pycarwings: Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-fz56baud/pycryptodome/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-buryeidq-record/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-fz56baud/pycryptodome/
00:02 util/package.py (ERROR)

Where can i install pycarwings2 in Hass.io. I tried to install https://github.com/BenWoodford/pycarwings2.git`

~ install https://github.com/BenWoodford/pycarwings2.git
BusyBox v1.27.2 (2018-01-29 16:01:29 GMT) multi-call binary.

Usage: install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [-t DIR] [SOURCE]... DEST

Copy files and set attributes

        -c      Just copy (default)
        -d      Create directories
        -D      Create leading target directories
        -s      Strip symbol table
        -p      Preserve date
        -o USER Set ownership
        -g GRP  Set group ownership
        -m MODE Set permissions
        -t DIR  Install to DIR

#53

Afraid I don’t use HASS.io so I can’t be much help here


#54

Nissan appear to have changed something in their API so this is now broken :frowning:

Back to fixing things I go.


#55

So everything started working for me again. I am pretty sure your right, Nissan changed something. The new Nissan App was not able to get my car’s location, but now it can. After I logged in with the official app again and then updated the location of the car everything started working again. There was also a reboot of my Pi during the time too.

Did you update something Ben in the last couple of days? Maybe something on Github that allowed my Pi to start getting the library correctly.

re[quote=“BenWoodford, post:54, topic:38663, full:true”]
Nissan appear to have changed something in their API so this is now broken :frowning:

Back to fixing things I go.
[/quote]


#56

There was also a couple of Hass.io updates. Maybe they changed a timeout limit for downloading the library?


#57

I haven’t touched anything no


#58

The other thing that I changed was upgrading my Apple Router to Google WiFi. Maybe that allowed the library to download before Home Assistant timed out? Maybe I should look at what has changed in Hass in the last couple of versions.


#59

I think that this project is looking very exciting. I would love to add this to my hass.io based HA, but I am not going to play around until it is available as a normal addon - added to hass.io by adding the Git repository URL.
Hass.io is (I believe) now the most popular way to install and run HA so until this add-on is available to add in a painless manner, many people who are not developers or especially skilled in coding will be missing out on something that looks really promising.
The Nissan Carwings web interface (I have a late 2014 Leaf using Carwings instead of Nissan Connect services) is AWFUL (Flash based, slow, many parts disfunctional) and the Android app (Nissan Connect EV will not even run on my fully up to date OnePlus phone. Anything that helps me to avoid using the terrible Nissan interface would be so welcome.
Thanks for you efforts so far - my mouth is watering for an add-on that I can use.


#60

A mixture of lack of time and the library author not merging my PR is the limiting factor in getting it properly into HASS unfortunately.

The good news, by the way, is that it’s my car or Nissan’s servers not the component that’s playing up.


#61

Is the author of the pycarwings library just busy, or is it maybe a abandoned project?