home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.15k stars 29.83k forks source link

Generic Camera - Error getting new camera image #109739

Closed Anto79-ops closed 7 months ago

Anto79-ops commented 7 months ago

The problem

good day!

I have a template sensor that parses an image url like this:

#LocalAI Image Generations
- platform: rest
  name: "Image URL Sensor"
  unique_id: [redacted]
  resource: http://192.168.1.195:8080/v1/images/generations
  method: POST
  scan_interval: 43200
  timeout: 120 
  headers:
    Content-Type: application/json
  payload: > 
    {
    "prompt": "magnificent scenery, wide landscape, sharp and crisp background, very beautiful landscape, fantasy, birdview, best quality, masterpiece, ultra high res, dark blue light, photo, photorealistic, wide view, kkw-ph1, professional shot of house, {{ state_attr('weather.forecast_home', 'forecast')[0].condition }} day, humidity perception is {{ states('sensor.humidex_perception') }}, thermal perception is {{ states('sensor.thermalperception') }}, extreme low-angle shot, realistic photography, ultra detailedmagnificent scenery, wide landscape, sharp and crisp background, very beautiful landscape, old ruins buildings, fantasy, birdview, best quality, masterpiece, ultra high res, dark blue light, cloudy, photo, photorealistic, wide view, kkw-ph1|nude, human, nudes, naked, sex, horny, sexual",
    "size": "512x512",
    "model": "landscape-photoreal"
    }
  value_template: "{{ value_json.data[0].url }}"

which creates a sensor with state of an http:// url, as shown

Using the generic camera integration, it correctly displays the image that is parsed:

image

however, on every restart of core, an eror is logged

Logger: homeassistant.components.generic.camera
Source: components/generic/camera.py:172
Integration: Generic Camera (documentation, issues)
First occurred: 5:47:23 PM (1 occurrences)
Last logged: 5:47:23 PM

Error getting new camera image from 192_168_1_195: Request URL is missing an 'http://' or 'https://' protocol.

This log started on beta 2024.2.0b

thanks

What version of Home Assistant Core has the issue?

2024.2.0bx

What was the last working version of Home Assistant Core?

2024.1,x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Generic Camera

Link to integration documentation on our website

https://www.home-assistant.io/integrations/generic/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 7 months ago

Hey there @davet2001, mind taking a look at this issue as it has been labeled with an integration (generic) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `generic` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign generic` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


generic documentation generic source (message by IssueLinks)