I picked up the latest files, modified them to work on Hass.io, but I’m getting an error message, I’ve actually had this error the last week (give or take a few days) and it’s related to pycarwings. I’ve created an issue for it.
Unable to install package pycarwings2==2.5: Failed building wheel for pycryptodome python-jose-cryptodome 1.3.2 has requirement pycryptodome<3.4.0,>=3.3.1, but you’ll have pycryptodome 3.7.3 which is incompatible. pyrebase4 4.2.0 has requirement oauth2client==4.1.2, but you’ll have oauth2client 4.0.0 which is incompatible. broadlink 0.9 has requirement pycryptodome==3.4.11, but you’ll have pycryptodome 3.7.3 which is incompatible. Command “/usr/local/bin/python3 -u -c “import setuptools, tokenize;file=‘/tmp/pip-install-n_08kzfq/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-record-ftvogyx3/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=” failed with error code 1 in /tmp/pip-install-n_08kzfq/pycryptodome/ You are using pip version 18.0, however version 18.1 is available. You should consider upgrading via the ‘pip install --upgrade pip’ command.
What do I need for testing? At the moment I’m using hassio, I have the files in the custom_components folders. Do I need to update the files, or just restart HA?
Second this error:
Unable to install package pycarwings2==2.4: Failed building wheel for pycryptodome python-jose-cryptodome 1.3.2 has requirement pycryptodome<3.4.0,>=3.3.1, but you’ll have pycryptodome 3.7.3 which is incompatible. pyrebase4 4.2.0 has requirement oauth2client==4.1.2, but you’ll have oauth2client 4.0.0 which is incompatible. broadlink 0.9 has requirement pycryptodome==3.4.11, but you’ll have pycryptodome 3.7.3 which is incompatible.
Came after I picked up the latest files from filcole’s git I believe?
I’ve released pycarwings2.6 without any restriction on the version of pycryptodome that’s used, since old versions are logging in fine. I’ve pushed an update to the pull request that will use version 2.6 of pycarwings. Please test!!
I’m using custom_components and have edited the files (a few days ago) so do I have to download them again or just restart HA?
While I’m here, my 24kWh Leaf has only 11 bars remaining and shows 109% when fully charged, I notice that it reads this info from the nissan server, so could this be used to calculate the correct %?
I deleted all the associated files, downloaded the ones posted earlier in this thread, changed the files as mentioned also earlier in this thread.
Unfortunately it’s not working atm, here is the error log…
2019-01-22 23:54:55 ERROR (SyncWorker_7) [homeassistant.util.package] Unable to install package pycarwings2==2.6: Failed building wheel for pycryptodome
python-jose-cryptodome 1.3.2 has requirement pycryptodome<3.4.0,>=3.3.1, but you'll have pycryptodome 3.7.3 which is incompatible.
pyrebase4 4.2.0 has requirement oauth2client==4.1.2, but you'll have oauth2client 4.0.0 which is incompatible.
broadlink 0.9 has requirement pycryptodome==3.4.11, but you'll have pycryptodome 3.7.3 which is incompatible.
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-vt2w9fp9/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-record-zsiwwtvw/install-record.txt --single-version-externally-managed --prefix --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-vt2w9fp9/pycryptodome/
You are using pip version 18.0, however version 19.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
2019-01-22 23:54:55 ERROR (MainThread) [homeassistant.requirements] Not initializing nissan_leaf because could not install requirement pycarwings2==2.6
2019-01-22 23:54:55 ERROR (MainThread) [homeassistant.setup] Setup failed for nissan_leaf: Could not install all requirements.
I’ve also got the same error as @RoadkillUK using pycarwings2 2.6 and I looked in to a little more when this error started to appear and it seems that it came with Hass.io release 142.
Got it working partly again now. But it seems that battery isn’t updating properly.
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 232, in async_update_ha_state
state = self.state
File "/config/custom_components/sensor/nissan_leaf.py", line 51, in state
return round(self.car.data[DATA_BATTERY], 0)
TypeError: type str doesn't define __round__ method
I’m getting my log full of this error now, one every minute.
This is my latest issue:
.pycarwings2] Response HTTP Status Code: 200
2019-01-24 22:37:27 DEBUG (SyncWorker_7) [pycarwings2 .pycarwings2] Response HTTP Response Body: {“status”: 200,“RemoteACRecords”:{“OperationResult”:“START”,“Ope rationDateAndTime”:“2019/01/24 09:43”,“RemoteACOper ation”:“STOP”,“ACStartStopDateAndTime”:“2019-jan-24 1 0:44”,“ACStartStopURL”:"",“PluginState”:“NOT_CONNECTE D”,“ACDurationBatterySec”:“900”,"ACDurationPluggedSec ":“7200”,“PreAC_unit”:“C”,“PreAC_temp”:“22”,"Inc_temp ":“12”}}
2019-01-24 22:37:27 ERROR (MainThread) [homeassistant .core] Error doing job: Future exception was never re trieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/concurrent/futures/t hread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/nissan_leaf.py”, li ne 199, in refresh_leaf_if_necessary
self.refresh_data()
File “/config/custom_components/nissan_leaf.py”, li ne 225, in refresh_data
climate_response = self.get_climate()
File “/config/custom_components/nissan_leaf.py”, li ne 275, in get_climate
request = self.leaf.get_latest_hvac_status()
File “/config/deps/lib/python3.6/site-packages/pycarwings2/pycarwings2.py”, line 390, in get_latest_hvac _status
return CarwingsLatestClimateControlStatusResponse (response)
File “/config/deps/lib/python3.6/site-packages/pyca rwings2/responses.py”, line 310, in init
racr, on_key=“CruisingRangeAcOn”, off_key=“Cruisi ngRangeAcOff”)
File “/config/deps/lib/python3.6/site-packages/pyca rwings2/responses.py”, line 57, in set_cruising_rang es
self.cruising_range_ac_off_km = float(status[off key]) / 1000
KeyError: ‘CruisingRangeAcOff’
API is not returning CruisingRangeAcOff.
Sorry for the bad indentation or whatever, writing this from my phone. I do hope it can be of any help though. Great job despite the horrific api…
Nissan Servers are not returning data for me, but the error to do with string not being a float should be fixed in version 2.7 of pycarwings, which I’ve updated the pull request to use. Thanks for reporting.
return round(self.car.data[DATA_BATTERY], 0)
TypeError: type str doesn't define __round__ method
Fri Jan 25 2019 07:44:53 GMT+0100 (Central European Standard Time)
Unable to fetch car details... do you actually have a Leaf connected to your account?
Let’s see when the servers are up, I moved up to 2.7 for testing purposes.
Hi, Pretty sure that’s a bug in pycarwings2 that I think should be solved in pycarwings2 version 2.7. Can you confirm that’s the version that’s installed. Are you able to send me the logs through so help debug please?
From your previous comment:
While I’m here, my 24kWh Leaf has only 11 bars remaining and shows 109% when fully charged, I notice that it reads this info from the nissan server, so could this be used to calculate the correct %?