macxq / foxess-ha

Home Assistant & FoxESS integration. Monitor you photovoltaic installation directly from HA ☀️ ⚡️
114 stars 36 forks source link

No Values! #206

Closed muhkuh666 closed 6 months ago

muhkuh666 commented 9 months ago

Hello,

is someone else expecting no values with the up to date HA Foxess?

Dirk-Dirk-Dirk commented 9 months ago

Yes, Sinds this morning is the FoxEss data no longer available in HA. In the FoxEss Cloud App is everything normal.

LordKillZone commented 9 months ago

I can confirm, mine also stopped working. Maybe FoxESS updated something and this integration is no longer working.

efekthalo commented 9 months ago

From the logs I found so far: Unexpected error fetching FoxESS data: Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/foxess/sensor.py", line 125, in async_update_data token = await authAndgetToken(hass, username, hashedPassword) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/foxess/sensor.py", line 251, in authAndgetToken response = json.loads(restAuth.data) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

pkudlins commented 9 months ago

_ENDPOINT_ADDRESSBOOK = "https://www.foxesscloud.com/c/v0/device/addressbook?deviceID=" { "errno": 41809, "result": null }

arn1s-m commented 9 months ago

Btw, there's also an API https://www.foxesscloud.com/public/i18n/en/OpenApiDocument.html now. Maybe switch to that instead of getting values from portal? Under user profile can generate API key

LordKillZone commented 9 months ago

Btw, there's also an API https://www.foxesscloud.com/public/i18n/en/OpenApiDocument.html now. Maybe switch to that instead of getting values from portal? Under user profile can generate API key

But how to add this to Home assistant? Is there an intergration?

arn1s-m commented 9 months ago

Btw, there's also an API https://www.foxesscloud.com/public/i18n/en/OpenApiDocument.html now. Maybe switch to that instead of getting values from portal? Under user profile can generate API key

But how to add this to Home assistant? Is there an intergration?

That would require total refactoring of this integration or completely new one. Most likely quickest solution is to adapt/fixt the existing and for future releases switch to API

pkudlins commented 9 months ago

Btw, there's also an API https://www.foxesscloud.com/public/i18n/en/OpenApiDocument.html now. Maybe switch to that instead of getting values from portal? Under user profile can generate API key

But how to add this to Home assistant? Is there an intergration?

That would require total refactoring of this integration or completely new one. Most likely quickest solution is to adapt/fixt the existing and for future releases switch to API

API is restricted to 20 calls per day by default ;) Number of calls per day:20 Remaining calls for today:20

muhkuh666 commented 9 months ago

Btw, there's also an API https://www.foxesscloud.com/public/i18n/en/OpenApiDocument.html now. Maybe switch to that instead of getting values from portal? Under user profile can generate API key

But how to add this to Home assistant? Is there an intergration?

That would require total refactoring of this integration or completely new one. Most likely quickest solution is to adapt/fixt the existing and for future releases switch to API

API is restricted to 20 calls per day by default ;) Number of calls per day:20 Remaining calls for today:20

How do you call the API?

johannessteu commented 9 months ago

They actually restricted the API now. You do need to send the Timestamp and Signature flag. The signature flag can be computed as described in the API demo:

        timestamp = round(time.time() * 1000)
        signature = fr'{_url}\r\n{_token}\r\n{timestamp}'

But i'm unsure about the token for the initial login request. You could use the API for this but then you're really restricted

Maesch1992 commented 9 months ago

Same issues here. Hope it gonna be fixed soon

johannessteu commented 9 months ago

I don't think there is a "fix", they basically secured their API 😓

Maesch1992 commented 9 months ago

Hate that so much. I created the dashboard yesterday for hours.

fpacardoso commented 9 months ago

Same issues,

sambuca231 commented 9 months ago

Same issue

craigmcfly commented 9 months ago

Same here. First errors at 18:55 GMT on 19th Dec, and then from 02:44 GMT on 20th Dec it's stopped working completely.

Maesch1992 commented 9 months ago

Yes, they change API access on 20th Dec

Maesch1992 commented 9 months ago

We need a Superhero now :(

Maesch1992 commented 9 months ago

Does Foxess_modbus work for now?

jbarrett-fmad commented 9 months ago

I received the following from Fox support:

Regarding this issues raised this morning re API requests and the impact on 3rd party apps. The changes relate to the migration to V2 of the Fox Cloud and the implications for 3rd party solutions were not fully considered and none of this was known to the UK team until this morning. The was certainly not about taking out the competition as some have suggested. We will come up with a solution.

So I guess we'll see if they are able to provide a fix...

Maesch1992 commented 9 months ago

I received the following from Fox support:

Regarding this issues raised this morning re API requests and the impact on 3rd party apps. The changes relate to the migration to V2 of the Fox Cloud and the implications for 3rd party solutions were not fully considered and none of this was known to the UK team until this morning. The was certainly not about taking out the competition as some have suggested. We will come up with a solution.

So I guess we'll see if they are able to provide a fix...

Thanks for your information. Tried to send an email too but i think the foxess email server is overloaded 👯

craigmcfly commented 9 months ago

I received the following from Fox support:

Regarding this issues raised this morning re API requests and the impact on 3rd party apps. The changes relate to the migration to V2 of the Fox Cloud and the implications for 3rd party solutions were not fully considered and none of this was known to the UK team until this morning. The was certainly not about taking out the competition as some have suggested. We will come up with a solution.

So I guess we'll see if they are able to provide a fix...

I'm just impressed they have a support team, given some of the shocking UI decisions I've seen on their portal!

Thanks for the info.

Maesch1992 commented 9 months ago

Called FoxEss Germany now. I gave them my inverter Number. They gonna Update the Inverter now. It takes an hour then it should run again. Hope the best.

arn1s-m commented 9 months ago

_ENDPOINT_ADDRESSBOOK = "https://www.foxesscloud.com/c/v0/device/addressbook?deviceID=" { "errno": 41809, "result": null }

41809 error code corresponds to 'invalid token'.

muhkuh666 commented 9 months ago

Called FoxEss Germany now. I gave them my inverter Number. They gonna Update the Inverter now. It takes an hour then it should run again. Hope the best.

Sorry can you make it more precise? What to update? What did you request them?

MartinBlackburn commented 9 months ago

I've been having a little poke around - from what I can see two values in localStorage get set:

The token then gets used as a header for auth (token header on requests)

if you remove token, then you have to login again - probably expected really if you remove access, the page just hangs - changing the value ends up redirecting you to: https://www.foxesscloud.com/error/noPermissions

As the token is set client side (localstorage), I assume there will be a way to get this and use it to auth.

I've yet to work out where the token gets set in localStorage, but I suspect there will be a way to get the token and then use it

Maesch1992 commented 9 months ago

Called FoxEss Germany now. I gave them my inverter Number. They gonna Update the Inverter now. It takes an hour then it should run again. Hope the best.

Sorry can you make it more precise? What to update? What did you request them?

Sure.

I requested that my home assistant don't work since last night because they updated the API. ive asked him if he knows the third party integration. He approved. So he said to me that he starts a new OTA update for my inverter. I take approx one hour then everything should work again.

niallcook commented 9 months ago

@macxq needs to make contact with Craig Wollaston at FoxESS UK so that he can be added to the list of developers who need access to the cloud API. I have contact details if he needs them, but Craig has posted on the FoxESS Solar/Battery Owners Group on Facebook. Nothing end users can do at this point.

craigmcfly commented 9 months ago

@macxq needs to make contact with Craig Wollaston at FoxESS UK so that he can be added to the list of developers who need access to the cloud API. I have contact details if he needs them, but Craig has posted on the FoxESS Solar/Battery Owners Group on Facebook. Nothing end users can do at this point.

I wasn't aware of the FB group! Thanks!

niallcook commented 9 months ago

@macxq needs to make contact with Craig Wollaston at FoxESS UK so that he can be added to the list of developers who need access to the cloud API. I have contact details if he needs them, but Craig has posted on the FoxESS Solar/Battery Owners Group on Facebook. Nothing end users can do at this point.

I wasn't aware of the FB group! Thanks!

Yep, lots of discussion about this issue as it's also broken a key third party app as well as some Python automations. Seems like FoxESS UK weren't aware of it either, so someone's woken up to a lot of angry customers.

muhkuh666 commented 9 months ago

Called FoxEss Germany now. I gave them my inverter Number. They gonna Update the Inverter now. It takes an hour then it should run again. Hope the best.

Update doesnt solve it in my case!

johannessteu commented 9 months ago

@muhkuh666 that would also be super unexpected. The issue here occurs once you request the Fox Cloud API. There is no communication to the Inverter at all:

Scripts <-X--> Fox Cloud <---> Inverter
macxq commented 9 months ago

The new API they have exposed has some significant limitations, particularly in terms of how many times it can be called in a day. A limit of 20 calls per day is a substantial restriction – this only allows for fetching data four times a day 🤦.Screenshot 2023-12-20 at 13 55 28

I do not think it is worthwhile to migrate to the new API. Additionally, I cannot promise that I will have the time and knowledge to fix the existing solution

Maesch1992 commented 9 months ago

Called FoxEss Germany now. I gave them my inverter Number. They gonna Update the Inverter now. It takes an hour then it should run again. Hope the best.

Update doesnt solve it in my case!

Same. Wont work

kamyk commented 9 months ago

Same for me. I was surprised today morning. I think this is a time to move to modbus or other local solution.

muhkuh666 commented 9 months ago

Same for me. I was surprised today morning. I think this is a time to move to modbus or other local solution.

Ok what would "other local solution" be like, I have no Idea what to use?

Bishbosh02 commented 9 months ago

This is a pain I now have no way to track my usage so will have move over to getting the date over 485 https://github.com/StealthChesnut/HA-FoxESS-Modbus

fpacardoso commented 9 months ago

This is a pain I now have no way to track my usage so will have move over to getting the date over 485 https://github.com/StealthChesnut/HA-FoxESS-Modbus

Anyone know if this integration works in S-G2 Series?

jt1Kirk commented 9 months ago

ok, that means now out of the cloud and get the data locally from Modbus (RS485 to WIFI EW11).

niallcook commented 9 months ago

The new API they have exposed has some significant limitations, particularly in terms of how many times it can be called in a day. A limit of 20 calls per day is a substantial restriction – this only allows for fetching data four times a day 🤦.Screenshot 2023-12-20 at 13 55 28

I do not think it is worthwhile to migrate to the new API. Additionally, I cannot promise that I will have the time and knowledge to fix the existing solution

I believe that limitation is for individual user API keys. They have asked for any developers with third party integrations to contact them so that they can try and find a solution for those use cases. Appreciate that you may not have time, though, in which case it looks like everyone will have to move to a ModBus solution.

ruisantox commented 9 months ago

Same problem where. Can some one point me where I can ask for increase the API call to more than 20 ? To try to help find a way to communicate online to our fox inverters

Like said. It sound complicated to patch this way.

niallcook commented 9 months ago

Same problem where. Can some one point me where I can ask for increase the API call to more than 20 ? To try to help find a way to communicate online to our fox inverters

Like said. It sound complicated to patch this way.

Increasing your API calls won't solve the problem. The integration needs to be updated to use secure API signatures, and then Fox needs to grant access to that signature. The only viable solution right now is to switch to ModBus and use a different integration.

kamyk commented 9 months ago

On another side my Foxess connects by WIFI to Cloud and I have found some integration for that too (ModBUS LAN). Have you checked that?

niallcook commented 9 months ago

On another side my Foxess connects by WIFI to Cloud and I have found some integration for that too (ModBUS LAN). Have you checked that?

Integrations that use ModBus are unaffected by the API changes. Direct LAN integration (using the inverter ethernet port) has been disabled in the most recent firmware for some inverters.

kamyk commented 9 months ago

I think about that -> https://www.youtube.com/watch?v=jRTE9UZkpHU But I understand that maybe it was off from my inverter. Yes? I will test it later today and let you know here. Maybe it will work. I have ETH port and modbus port too, but so far I use only WIFI.

niallcook commented 9 months ago

I think about that -> https://www.youtube.com/watch?v=jRTE9UZkpHU But I understand that maybe it was off from my inverter. Yes?

This is the ModBus integration. The only way to get your inverter data into HA now.

ruisantox commented 9 months ago

Same problem where. Can some one point me where I can ask for increase the API call to more than 20 ? To try to help find a way to communicate online to our fox inverters Like said. It sound complicated to patch this way.

Increasing your API calls won't solve the problem. The integration needs to be updated to use secure API signatures, and then Fox needs to grant access to that signature. The only viable solution right now is to switch to ModBus and use a different integration.

The API is the correct way if they increase the number of calls. The way here is a brilliant way of doing it. That I say thank you. Because used to work supper nice. Modbus is the local way of doing it. But requires more hardware. Need to check if can connect by usb a ethernet card.

Maesch1992 commented 9 months ago

I think about that -> https://www.youtube.com/watch?v=jRTE9UZkpHU But I understand that maybe it was off from my inverter. Yes?

This is the ModBus integration. The only way to get your inverter data into HA now.

But i dont work with the new Firmware right? Because Ethernet is deactivated. I got the foxess smart lan dongle. But it doesnt shows IP Adress or Mac adress in Inverter or Router.

niallcook commented 9 months ago

Same problem where. Can some one point me where I can ask for increase the API call to more than 20 ? To try to help find a way to communicate online to our fox inverters Like said. It sound complicated to patch this way.

Increasing your API calls won't solve the problem. The integration needs to be updated to use secure API signatures, and then Fox needs to grant access to that signature. The only viable solution right now is to switch to ModBus and use a different integration.

The API is the correct way if they increase the number of calls. The way here is a brilliant way of doing it. That I say thank you. Because used to work supper nice. Modbus is the local way of doing it. But requires more hardware. Need to check if can connect by usb a ethernet card.

I don't disagree that a cloud integration is easier (it's what I've been using), but I say again that increasing the number of API calls will not solve the problem. FoxESS has blocked access to all third party cloud apps and integrations as of last night. There is a meeting tomorrow or Friday with some of the developers of those apps to see how it can be resolved. I don't know if @macxq is taking part in that call.

niallcook commented 9 months ago

I think about that -> https://www.youtube.com/watch?v=jRTE9UZkpHU But I understand that maybe it was off from my inverter. Yes?

This is the ModBus integration. The only way to get your inverter data into HA now.

But i dont work with the new Firmware right? Because Ethernet is deactivated. I got the foxess smart lan dongle. But it doesnt shows IP Adress or Mac adress in Inverter or Router.

ModBUS still works fine. The LAN port on the inverter doesn't work with newer firmware. I don't know what the smart LAN dongle is.