Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't log in #1

Closed
Machu95 opened this issue Oct 10, 2021 · 10 comments
Closed

Can't log in #1

Machu95 opened this issue Oct 10, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@Machu95
Copy link

Machu95 commented Oct 10, 2021

I can't get this working. I still get following error

Logger: homeassistant.components.sensor
Source: custom_components/foxess_ha/sensor.py:77
Integration: Sensor (documentation, issues)
First occurred: 11:10:26 (1 occurrences)
Last logged: 11:10:26

Error while setting up foxess platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/foxess_ha/sensor.py", line 77, in async_setup_platform
token = json.loads(restAuth.data)["result"]["token"]
TypeError: 'NoneType' object is not subscriptable

Config like in readme file.

Version v0.1

@Machu95
Copy link
Author

Machu95 commented Oct 10, 2021

Installed version from source and i get now following error

Logger: custom_components.foxess_ha.sensor
Source: custom_components/foxess_ha/sensor.py:78
Integration: foxess_ha
First occurred: 11:27:21 (1 occurrences)
Last logged: 11:27:21

Unable to login to FoxESS Cloud: {"errno":41807,"result":null}

@macxq
Copy link
Owner

macxq commented Oct 11, 2021

Unable to login to FoxESS Cloud: {"errno":41807,"result":null}is happening when you pass bad credentials.

Are you sure that you pass the right? if yes please execute this command with replaced PUT_YOUR_USERNAME_HERE and PUT_YOUR_PASSWORD_HERE with your credentials:

curl 'https://www.foxesscloud.com/c/v0/user/login' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'lang: en' \
  --data-raw '{"user":"PUT_YOUR_USERNAME_HERE,"password":"PUT_YOUR_PASSWORD_HERE"}' \
  --compressed

And confirm the the respons start with : {"errno":0,"result":{"token":

⚠️ Do not share the whole response here, it contains token to your account ;)

@macxq
Copy link
Owner

macxq commented Oct 11, 2021

🤔 The second clue is the whitespaces in the configuration.yaml, please make sure that you have just one space after username: and real username and no whitespace at the end , and the same situation with password

@Machu95
Copy link
Author

Machu95 commented Oct 11, 2021

I executed that command and I get {"errno":41807,"result":null}. I.m sure that i have login and password corect in configuration.yaml.

@Machu95
Copy link
Author

Machu95 commented Oct 11, 2021

I think that this can be case sensitive problem. My login starts from big letter. I can't change this for test.

@macxq
Copy link
Owner

macxq commented Oct 12, 2021

@Machu95 I have tested on my configuration.yaml, i have the username starting from small letter, i have changed it to bit and it stopped working - so it is case sensitive

@macxq
Copy link
Owner

macxq commented Oct 13, 2021

@Machu95 can you contact me via email? i have one more idea on debugging it

@BigManDave
Copy link
Contributor

Same problem here.
Just got my inverter installed today, excited to use your integration but "Unable to login to FoxESS Cloud: {"errno":41807,"result":null}"

Not sure if you're already on the right track but my username also contains capitals, and a dash. Password is all lower case.

@macxq
Copy link
Owner

macxq commented Oct 13, 2021

@BigManDave reach out to me via email, I need your credentials to debug it :)

@Machu95
Copy link
Author

Machu95 commented Oct 13, 2021

After update I can log in

@macxq macxq closed this as completed Oct 13, 2021
@macxq macxq added the bug Something isn't working label Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants