Generic Camera as live preview of Weather

Hello!
I would like to present a live preview of site Meteo in my lovelace frontend. Iframe doesn’t work, i mean i have two scrolls here, i would like to simply scale it down which is not possible. So i heard i can use generic camera

This is my configuration.yaml

camera:
  - platform: generic
    name: Weather2
    still_image_url: https://www.meteo.pl/um/php/meteorogram_id_um.php?ntype=0u&id=606
    content_type: 'image/png'

This is my lovelace config:

  - camera_image: camera.weather2
    entity: camera.weather2
    name: Meteogram for xxxx
    tap_action:
      action: more-info
    type: picture-entity

And it is not working.

camera.weather2 has state “idle” and attributes:

access_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx friendly_name: Weather2 entity_picture: /api/camera_proxy/camera.weather2?token=xxxxxxxxxxxxxxxxxxxxxxxxxx supported_features: 0

What can i do to make it work? Any clues? I could use img link but it changes everyday so it cannot be that way.

I will be greatfull for any help. Thanks You in advance.

I think you have to use a URL to an actual image file, but the URL you have provided goes to an entire webpage.

Maybe use the Downloader component to download the image every day using a template for the date, and give the downloaded file a static name that you can then point to using a camera?

downloader:
  download_dir: /downloads
# You'll need to point to your actual download directory

automation:
  - alias: "Weather Download"
    initial_state: "on"
    trigger:
      - platform: time
        at: '03:00:00'  
# using 3am as an example; you'll want to figure out when the file is updated each day.
    action:
      - service: downloader.download_file
        data_template:
          url: https://www.meteo.pl/um/metco/mgram_pict.php?ntype=0u&fdate={{ as_timestamp(now()) | timestamp_custom('%Y%m%d',true) }}&row=458&col=225&lang=pl
          filename: weather_preview.png
          overwrite: true
camera:
  - platform: local_file
    file_path: /downloads/weather_preview.png
1 Like