tijsverkoyen / HomeAssistant-FusionSolar

Integrate FusionSolar into your Home Assistant.
MIT License
133 stars 25 forks source link

All sensors unavailable (Kiosk) #143

Closed acombos closed 5 months ago

acombos commented 5 months ago

As of a few hours ago, all devices exposed in HA are unavailable.

HA Version: Core 2024.1.5 Supervisor 2023.12.1 Operating System 11.4 Frontend 20240104.0

Integration Version: v3.0.2

Using Kiosk mode, the URL is still valid (checked on browser, was set ~2 months ago.

Logs show:

Logger: custom_components.fusion_solar.sensor
Source: helpers/update_coordinator.py:300
Integration: FusionSolar ([documentation](https://github.com/tijsverkoyen/HomeAssistant-FusionSolar), [issues](https://github.com/tijsverkoyen/HomeAssistant-FusionSolar/issues))
First occurred: 10:02:02 (8 occurrences)
Last logged: 11:12:03

Unexpected error fetching FusionSolarKiosk 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/fusion_solar/sensor.py", line 79, in async_update_kiosk_data
    data[f'{DOMAIN}-{kiosk.id}'] = await hass.async_add_executor_job(api.getRealTimeKpi, kiosk.id)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/fusion_solar/fusion_solar/kiosk/kiosk_api.py", line 37, in getRealTimeKpi
    jsonData[ATTR_DATA] = json.loads(html.unescape(jsonData[ATTR_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)

No changes or updates were made between yesterday (working normally) and today (not working).

tijsverkoyen commented 5 months ago

I would suggest to give it some time. As there are already many other issues that resolved themself after a while, or after a reboot of Home Assistant:

migube commented 5 months ago

same issue since 2 days no more data, can it be they are working on the platform regardingAPI's? on the Fusionsolar site, there is data. and a mention about ongoing activities. (I restarted HA)

tijsverkoyen commented 5 months ago

I don't know about Huawei infrastructure. I'm not related to them or working for them. I just wrote this integration in my spare time to see data in my Home Assistant ;-)

If you are using Kiosk inside Home Assistant. I would strongly suggest to switch to the Northbound API. The Kiosk mode is using an undocumented API.

AndreVde commented 5 months ago

Hi all. Same problem here. Also using kiosk mode. The only way to repair this is to reïnstall the integration but after a few days it breaks again (url still works). Too bad I can't use the northbound api because my installer doesn't cooperate very well.

acombos commented 5 months ago

I confirm that today it works normally, without any further restarts of HA or reinstallations of integration.