peterbuga / HASS-sonoff-ewelink

Home Assistant component to control Sonoff/eWeLink devices with original firmware
MIT License
792 stars 296 forks source link

Temporary fix HA 0.115 UUID issue. Setup failed for sonoff: Requirements for sonoff not found: ['uuid']. #261

Open tyjtyj opened 3 years ago

tyjtyj commented 3 years ago

UUID is some hex

Generate uuid from a python command python -c 'import uuid; print(uuid.uuid4())' or simply type any hex with the following format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

eg. PLEASE CHANGE THIS 12345678-abcd-1234-abcd-123456789012

Open init.py file

Remove UUID requirement Line 45 REQUIREMENTS = ['websocket-client==0.54.0']

Comment out Line 210 #import uuid

Line 223 self._imei = 'your uuid here'

mirasu commented 3 years ago

Funciono para mi, solo decir que hay que dejar las comillas self._imei = 'your uuid here' yo las quite y no funcionaba :-D

gracias!

brunolinsalves commented 3 years ago

It worked for me.

Thanks!

gtrancillo commented 3 years ago

@tyjtyj You are right. But your line numbers are wrong, These are the correct ones.

Generate UUID from a python command python -c 'import uuid; print(uuid.uuid4())' or simply type any hex with the following format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Replace line 26: REQUIREMENTS = ['uuid', 'websocket-client==0.54.0'] for this: REQUIREMENTS = ['websocket-client==0.54.0']

Line 121: import uuid for #import uuid

Line 134: self._imei = str(uuid.uuid4()) for self._imei = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

Tahutipai commented 3 years ago

For anyone unsure which file to edit:

vi /root/config/custom_components/sonoff/__init__.py

TrommlerHH commented 3 years ago

Sorry, I am completely stuck as a newbie.

I tried to install the AlexxIT-sonoff-ingetragtion with HACS, but I also ended up with this "requirements not found"-error.

I do not understand what to do with the phyton-command. It should not be added to the init-file, right?

I also checked my init-file but I could not find the mentioned lines. Searching the entire file for "requirements" or "websocket" failed.

This is how the first lines of my init-file look like: init py

jamespo commented 3 years ago

I found you only need to remove uuid from the requirements line, uuid is in the standard library.

montyha66 commented 3 years ago

Hi unfortunately, nothing above has helped with the latest HomeAssistant Release 2020.12. to fix the issue below. Actually the Error disappears, but I was sill not able to see my Ewelink switches and sensors. So I have to downgrade to 0.114.4 the last version which is working for me.

Any suggestions how to fix?

After install HomeAssistant Release 2020.12. I have got following: 14/12/2020 10:35 Setup failed for sonoff: Requirements for sonoff not found: ['uuid']. 10:32:58 AM – setup.py (ERROR) Unable to install package uuid: ERROR: Could not find a version that satisfies the requirement uuid==1000000000.0.0 (from -c /usr/src/homeassistant/homeassistant/package_constraints.txt (line 56)) (from versions: 1.30) ERROR: No matching distribution found for uuid==1000000000.0.0 (from -c /usr/src/homeassistant/homeassistant/package_constraints.txt (line 56)) WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command. 10:32:58 AM – util/package.py (ERROR)

tyjtyj commented 3 years ago

Hi unfortunately, nothing above has helped with the latest HomeAssistant Release 2020.12. to fix the issue below. Actually the Error disappears, but I was sill not able to see my Ewelink switches and sensors. So I have to downgrade to 0.114.4 the last version which is working for me.

Any suggestions how to fix?

After install HomeAssistant Release 2020.12. I have got following: 14/12/2020 10:35 Setup failed for sonoff: Requirements for sonoff not found: ['uuid']. 10:32:58 AM – setup.py (ERROR) Unable to install package uuid: ERROR: Could not find a version that satisfies the requirement uuid==1000000000.0.0 (from -c /usr/src/homeassistant/homeassistant/package_constraints.txt (line 56)) (from versions: 1.30) ERROR: No matching distribution found for uuid==1000000000.0.0 (from -c /usr/src/homeassistant/homeassistant/package_constraints.txt (line 56)) WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available. You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command. 10:32:58 AM – util/package.py (ERROR)

if you remove it right. there should be no uuid requirement.

josrafafonlo commented 3 years ago

@tyjtyj You are right. But your line numbers are wrong, These are the correct ones.

Generate UUID from a python command python -c 'import uuid; print(uuid.uuid4())' or simply type any hex with the following format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Replace line 26: REQUIREMENTS = ['uuid', 'websocket-client==0.54.0'] for this: REQUIREMENTS = ['websocket-client==0.54.0']

Line 121: import uuid for #import uuid

Line 134: self._imei = str(uuid.uuid4()) for self._imei = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

I found a way to fix this for good: Do pip install uuid once its done go to the file and revert line 26 to require 'uuid' (Or leave it alone if havent touched it yet) Then add the line import uuid under import websocket... (My file came without it) Finally revert line 134 to (or leave it as) original Save and restart hass. Now it should work as intended

eole210 commented 3 years ago

@tyjtyj You are right. But your line numbers are wrong, These are the correct ones. Generate UUID from a python command python -c 'import uuid; print(uuid.uuid4())' or simply type any hex with the following format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Replace line 26: REQUIREMENTS = ['uuid', 'websocket-client==0.54.0'] for this: REQUIREMENTS = ['websocket-client==0.54.0'] Line 121: import uuid for #import uuid Line 134: self._imei = str(uuid.uuid4()) for self._imei = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

I found a way to fix this for good: Do pip install uuid once its done go to the file and revert line 26 to require 'uuid' (Or leave it alone if havent touched it yet) Then add the line import uuid under import websocket... (My file came without it) Finally revert line 134 to (or leave it as) original Save and restart hass. Now it should work as intended

@josrafafonlo, sorry if that is dummy question but where do you do 'pip install uuid'? It is clearly not in the file itself so where is it please? Thanks!