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

Newest Core Update - No Image anymore #60

Closed
Suschibomber opened this issue Nov 7, 2024 · 19 comments
Closed

Newest Core Update - No Image anymore #60

Suschibomber opened this issue Nov 7, 2024 · 19 comments

Comments

@Suschibomber
Copy link

I did the latest core update this morning and since then no chart has been shown to me.

@yahoogreg
Copy link

Same for me, Camera.ADRESS no longer exists in Home Assistant since core update to 2024.11.0

@mimainka
Copy link

mimainka commented Nov 7, 2024

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 365, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/tibber_custom/camera.py", line 26, in async_setup_platform
    dev.append(TibberCam(home, hass))
               ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tibber_custom/camera.py", line 45, in __init__
    super().__init__(self._name, self._path)
TypeError: LocalFile.__init__() missing 1 required positional argument: 'unique_id'

from my logs

@jove01
Copy link

jove01 commented Nov 7, 2024

same here

@Suschibomber
Copy link
Author

@Danielhiversen Have you already found a solution?

@Danielhiversen
Copy link
Owner

Seems that it is a breaking change in last version of Home Assistant.
I have not looked into it, and not sure when I will find time for that

@Suschibomber
Copy link
Author

Seems that it is a breaking change in last version of Home Assistant.
I have not looked into it, and not sure when I will find time for that

Ok too bad. Have used your widget daily :(
If I can do something, please let me know.

@mimainka
Copy link

mimainka commented Nov 8, 2024

I manipulated parts of the camera.py file of the custom component a bit to get a „unique id“ and it’s working for me.
but id say it’s rather dirty and probably not good coding (hardcoding) :-(

class TibberCam(LocalFile):
    def __init__(self, home, hass):
        matplotlib.use("Agg")

        self._name = home.info["viewer"]["home"]["appNickname"]
        if self._name is None:
            self._name = home.info["viewer"]["home"]["address"].get("address1", "")
        self._path = hass.config.path(f"www/prices_{self._name}.png")
        self._home = home
        self.hass = hass
        self._cons_data = []
        self._last_update = dt_util.now() - datetime.timedelta(hours=1)
        self.realtime_state = None
        self.unique_id = f"tibberprice_unique_id"
        # hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, self._generate_fig)
#        super().__init__(self._name, self._path)

        super().__init__(self._name, self._path, self.unique_id)

TWitzenrath pushed a commit to TWitzenrath/home_assistant_tibber_custom that referenced this issue Nov 9, 2024
@TWitzenrath
Copy link
Contributor

@Danielhiversen made @mimainka's change into a PR, slightly extended to not hardcode the uid. Not that much of a contribution, just wanted to make it easy for you as you mentioned time constraints.

@mimainka
Copy link

mimainka commented Nov 9, 2024

@TWitzenrath works like a charm for me. No errors in log as well.

@Suschibomber
Copy link
Author

@Danielhiversen made @mimainka's change into a PR, slightly extended to not hardcode the uid. Not that much of a contribution, just wanted to make it easy for you as you mentioned time constraints.

Sorry for the stupid question, but how can I find your solution with me so that it works again? Do I just have to paste your code into the file and it should run again?

@TWitzenrath
Copy link
Contributor

TWitzenrath commented Nov 10, 2024

@Suschibomber Just wait for the update. Or go to Settings->System->Updates and hit the refresh button, then the update should show up instantly

@Suschibomber
Copy link
Author

I installed the 0.52 but it still doesn't show me a graph. It's as if the image is not found, so such a symbol.

@TWitzenrath
Copy link
Contributor

@Suschibomber did you restart homeassistant after updating? Is there anything in the logs?

@yahoogreg
Copy link

@Suschibomber: the upgrate 0.52 created a new entity with the name camera.ADRESS_2.
I used this new entity and at first this resulted in a strange picture but after the HA restart everything was fine.

Thanks to @Danielhiversen and @TWitzenrath for your support

@mimainka
Copy link

@Suschibomber
As an alternative:
Check in your www/ folder for a file named „prices_youradress.png
And then use the image card with /local/imagename.png

@Suschibomber
Copy link
Author

@Suschibomber: the upgrate 0.52 created a new entity with the name camera.ADRESS_2.
I used this new entity and at first this resulted in a strange picture but after the HA restart everything was fine.

Thanks to @Danielhiversen and @TWitzenrath for your support

No new entity has been added to me. Just the old camera.leo 😕

@Suschibomber
Copy link
Author

I have now tested everything possible. Cleared the cache and downloaded the HACS extension again. It just doesn't show a picture anymore :( Any tips on what I'm doing wrong?
tibber_custom_missing_image

@jove01
Copy link

jove01 commented Nov 12, 2024

Deleted the Integration and the picture. Restart ha and Install again.

@Suschibomber
Copy link
Author

Deleted the Integration and the picture. Restart ha and Install again.

Thanks. That solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants