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

[FEAT] Documentation for adding image to picture card #120

Closed
jonwilliams84 opened this issue Oct 7, 2021 · 10 comments
Closed

[FEAT] Documentation for adding image to picture card #120

jonwilliams84 opened this issue Oct 7, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@jonwilliams84
Copy link

I am trying to add the last image to a picture-element card using the following as an example:

http://double-take.jetson.local/api/storage/matches/{{states.sensor.double_take_unknown.attributes.unknown.filename}}?box=true

In developer tools and templates, this renders the url correctly as:

http://double-take.jetson.local/api/storage/matches/670f03f6-7d88-49ba-be61-66789f6fa554.jpg?box=true

However the picture doesn't show in a card.

What am I missing?

If set this as a camera in HA config it works but surely there is an easier way to do it?

  - platform: generic
    still_image_url: http://double-take.jetson.local/api/storage/matches/{{states.sensor.double_take_unknown.attributes.unknown.filename}}?box=true
    name: UnknownFaces

Regards,

Jon

@jonwilliams84 jonwilliams84 added the enhancement New feature or request label Oct 7, 2021
@jakowenko
Copy link
Owner

jakowenko commented Oct 7, 2021

It doesn't look like templates are supported in picture entities. There is a way to do it though with a generic camera entity.

camera:
  - platform: generic
    input: http://double-take.jetson.local/api/storage/matches/{{states.sensor.double_take_unknown.attributes.unknown.filename}}?box=true
    name: UnknownFaces

Then your card would look like this.

type: picture-entity
entity: camera.unknownfaces
show_state: false

Here's how mine looks.
Screen Shot 2021-10-07 at 10 09 19 AM

I will make sure to include this in the docs with an example.

Do you think it's worth writing out latest <name>.jpg and unknown.jpg images? Then there would be no need to dynamically change the filename in a template and you could probably use the picture entity rather than a camera one.

@jonwilliams84
Copy link
Author

Yeah - I have set it up as a generic camera and its fine for now. I am just trying to phase out my use of deepstack but retain the ease of integration with HA.

Maybe add an arg / option / bool to enable ${cameraName}_latest.jpg and ${personName}_latest.jpg? This way people could have a card for each camera or person latest image.

Alternatively - maybe an add-on for HA is the answer - This could create entities automatically for each attribute of the double-take output/result.

@tkdrob
Copy link

tkdrob commented Oct 8, 2021

Hi. I have an add-on made but for some reason ingress does not work yet: https://github.com/tkdrob/double-take-hass-addon

@jakowenko
Copy link
Owner

Yeah - I have set it up as a generic camera and its fine for now. I am just trying to phase out my use of deepstack but retain the ease of integration with HA.

Maybe add an arg / option / bool to enable ${cameraName}_latest.jpg and ${personName}_latest.jpg? This way people could have a card for each camera or person latest image.

Alternatively - maybe an add-on for HA is the answer - This could create entities automatically for each attribute of the double-take output/result.

I will working on a camera/person latest.jpg in the next release. That will make adding those cards a lot easier!

Hi. I have an add-on made but for some reason ingress does not work yet: https://github.com/tkdrob/double-take-hass-addon

Wow! This is awesome, I run HA in a container so I don't currently have an addon store to test with, but it was on my list of things to build in. Nice work!

@tkdrob
Copy link

tkdrob commented Oct 8, 2021

Yeah - I have set it up as a generic camera and its fine for now. I am just trying to phase out my use of deepstack but retain the ease of integration with HA.
Maybe add an arg / option / bool to enable ${cameraName}_latest.jpg and ${personName}_latest.jpg? This way people could have a card for each camera or person latest image.
Alternatively - maybe an add-on for HA is the answer - This could create entities automatically for each attribute of the double-take output/result.

I will working on a camera/person latest.jpg in the next release. That will make adding those cards a lot easier!

Hi. I have an add-on made but for some reason ingress does not work yet: https://github.com/tkdrob/double-take-hass-addon

Wow! This is awesome, I run HA in a container so I don't currently have an addon store to test with, but it was on my list of things to build in. Nice work!

Could you please add a logo.png? I don't think you have one. Again, ingress is not working yet and I'm unable to make it work. Believe me I tried. Perhaps you can look into that? Port 3000 is the default port which can also conflict with people using zwavejs2mqtt addon.

@jakowenko
Copy link
Owner

@jonwilliams84 the new beta build includes a api/latest/<name>.jpg image, where <name> can either be the person or the camera. ?box=true is also supported and if you have auth enabled, make sure to pass a &token=XXX.

This should allow you to use it in a picture card now on HA.

@jakowenko
Copy link
Owner

Yeah - I have set it up as a generic camera and its fine for now. I am just trying to phase out my use of deepstack but retain the ease of integration with HA.
Maybe add an arg / option / bool to enable ${cameraName}_latest.jpg and ${personName}_latest.jpg? This way people could have a card for each camera or person latest image.
Alternatively - maybe an add-on for HA is the answer - This could create entities automatically for each attribute of the double-take output/result.

I will working on a camera/person latest.jpg in the next release. That will make adding those cards a lot easier!

Hi. I have an add-on made but for some reason ingress does not work yet: https://github.com/tkdrob/double-take-hass-addon

Wow! This is awesome, I run HA in a container so I don't currently have an addon store to test with, but it was on my list of things to build in. Nice work!

Could you please add a logo.png? I don't think you have one. Again, ingress is not working yet and I'm unable to make it work. Believe me I tried. Perhaps you can look into that? Port 3000 is the default port which can also conflict with people using zwavejs2mqtt addon.

Would this logo work? https://github.com/jakowenko/double-take/blob/master/frontend/public/apple-touch-icon.png

@tkdrob
Copy link

tkdrob commented Oct 12, 2021

This "logo" will work as an icon but a logo usually includes the name in the image just like Frigate NVR does.

jakowenko added a commit that referenced this issue Oct 12, 2021
# [1.4.0](v1.3.0...v1.4.0) (2021-10-12)

### Bug Fixes

* **api:train:** validate mime type and result of database.get.fileByFilename ([#123](#123)) ([d5e050f](d5e050f))
* **api:** catch facebox error before normalizing data ([67c93c4](67c93c4))
* **api:** delete orphaned db records when deleting training folder / files ([f031545](f031545))
* **ui:** fix multiselect dropdowns when open and scrolling ([ae2085b](ae2085b))
* **ui:** theme wouldn't load if setting to same theme ([88b0976](88b0976))

### Features

* **api:** api/latest/<name>.jpg ([#120](#120)) ([cd765ae](cd765ae))
* **api:** use camera name when using custom mqtt topic ([70a4ce3](70a4ce3))
* **ui:** enable/disable sockets on matches page ([bb95e0a](bb95e0a))
@jakowenko
Copy link
Owner

@tkdrob, if you want to message me on Discord, I can get a logo created for you with the name in it.

@jonwilliams84, I'm going to close this since it's included in v1.4.0. There is a small fix coming in v1.4.1 which will be out in a few hours.

Feel free to reopen if you run into issues with it.

@jakowenko
Copy link
Owner

FYI, the beta build and future release will have the latest images under api/storage/latest/<name>.jpg to keep it under the storage namespace with the other files.

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

No branches or pull requests

3 participants