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

Enhanced home assistant integration #148

Closed
helgeerbe opened this issue Jul 17, 2021 · 12 comments
Closed

Enhanced home assistant integration #148

helgeerbe opened this issue Jul 17, 2021 · 12 comments
Labels
enhancement New feature or request

Comments

@helgeerbe
Copy link
Owner

helgeerbe commented Jul 17, 2021

With release 2021.7 home assistant mqtt device discovery offers (besides switches and sensors) two new types which could be used by picframe to avoid manual configuration.

  • number for
    • fade time
    • time delay
    • brightness
  • select for
    • directory selection

I put the mqtt changes in a separate branch ha_mqtt_integration. No changes on topics for commands to picframe.

So only input text helpers remain for text based filters

  • tags
  • location
  • date to
  • data from

To avoid further manual configurations in the automations. I created a blueprint.
Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.
The gist url can also directly used in home assistant.

image

So most of the time. Only the date format string has to be entered to reflect the local date format. For the other settings, the default values could be used and need only to be changed, if you are using more than one picframe. They are linking picframes mqtt sensors to the input text helper ui elements.

@helgeerbe
Copy link
Owner Author

helgeerbe commented Jul 20, 2021

I pulled #150 into dev. This is a breaking change for home assistant configuration.

You have to uninstall the old integration.

  1. Open mqtt integration and delete picframe device.
  2. Delete all picframe automations
  3. Delete all helpers except
  • input_text.picframe_tags
  • input_text.picframe_location
  • input_text.picframe_date_to
  • input_text.picframe_date_from

To setup the new integration:

  1. run picframe
  2. wait for a pic change (this will send proper values to the ui elements) or press next image
  3. Open ui cards and and replace the old (now) unreferenced elements with the newly created elements
  4. press Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled. to import new blueprint.
  5. Click on 'Create new automation' link.
  6. change date format to the format used in your date_to/date_from input_text helpers (has to be the same date format)
    image
  7. That's it. Have fun.

@sapnho
Copy link

sapnho commented Aug 21, 2021

@helgeerbe I guess that means we should update your article: https://www.thedigitalpictureframe.com/integrate-raspberry-pi-picture-frame-home-assistant/ as well.

@helgeerbe
Copy link
Owner Author

Yes. Sorry for that. But this makes the setup much easier. Also if you would like to run more than one picframe in home assistant.

@helgeerbe helgeerbe added the enhancement New feature or request label Aug 26, 2021
@helgeerbe
Copy link
Owner Author

I described how to setup home assistant integration or upgrade the integration in the wiki.

@sapnho
Copy link

sapnho commented Aug 26, 2021

I described how to setup home assistant integration or upgrade the integration in the wiki.

Thanks, great! I will update your blog article as soon as I find a quiet moment.

@helgeerbe
Copy link
Owner Author

@sapnho Thanks. Please note that @paddywwoof is going to update pi3d first. So the new integration is valid only for the dev branch at the moment.

@sapnho
Copy link

sapnho commented Aug 26, 2021

Yes, I'll wait. Probably not much time in the coming weeks anyway.

@sapnho
Copy link

sapnho commented Jan 2, 2022

Hi @helgeerbe, I was working on the rewrite of the https://www.thedigitalpictureframe.com/integrate-raspberry-pi-picture-frame-home-assistant article today. With your new blueprint, the integration should be a lot easier indeed.
However, I am struggling with the text entry for tags, dates, and locations where I cannot enter any values.
It looks like this:

Lovelace

My helpers are

Helpers

Any idea where I might have taken a wrong turn? Thanks!

@helgeerbe
Copy link
Owner Author

Hi @sapnho looks good for me. If I remember right, you will get the first controls, when picframe starts. But you have to wait at least for the second image. While changing image the attribute controls are send to picframe (you can speed this up, clicking on next image).

@sapnho
Copy link

sapnho commented Feb 6, 2022

@helgeerbe I only now got around to updating the blog article but I still have the same issue that I cannot enter any text in location, tags, date from, or date to.
This is the draft update article: https://www.thedigitalpictureframe.com/?p=19080&preview=1&_ppp=cd318d49da
I guess I am doing something wrong with the Helpers but I have no idea what.

@helgeerbe
Copy link
Owner Author

Hi @sapnho, what do you mean with: " I cannot enter any text....". On the home assistant webpage, you can't enter any text?

Check helpers and Folder-Card.
Bildschirmfoto 2022-02-07 um 12 29 25

entities:
  - entity: sensor.picframe_image_counter
    name: Bilder
  - entity: select.picframe_directory
    name: Directory
  - entity: input_text.picframe_tags_filter
    name: Stichwortsuche
  - entity: input_text.picframe_location_filter
    name: Ortssuche
  - entity: input_text.picframe_date_from
    name: Bilder ab (TT.MM.JJJJ)
  - entity: input_text.picframe_date_to
    name: Bilder bis (TT.MM.JJJJ)
show_header_toggle: false
theme: Backend-selected
title: Filter
type: entities
state_color: true

Entity Ids must be the same.

@sapnho
Copy link

sapnho commented Feb 7, 2022

Perfect, thanks @helgeerbe.
I had "sensor" instead of "input_text" in my automatically created fields. Now it works!

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

2 participants