Features Wishlist

Pages as entities

Completed

SchumeySuggested this wish Β·

What would you like to add

I'd like to add the feature that every page has it own entity, so I can use them in my automations.

For example, I got a page for my 3D printer on Tessera, and I'd like to have an automation that changes the shown page to the printer page when I'm printing.

How this relates to Home Assistant

It adds an entity for every screen page I have in Tessera.

Pictures, mockups, or examples

No response

Before submitting

  • I searched the existing issues and this has not already been requested

Originally shared on GitHubOriginal authors and dates are preserved.

View original

Discussion 2

Add a comment
MaxGramser Admin

Hi @Schumey, good news: this already works, without an entity per page. Every screen has the action esphome.<screen>_show_page in Home Assistant. It wakes the screen if it is in standby, closes an open card or the settings, and shows the page you ask for. page is the number the editor shows, 1 for the first page.

An automation that shows the printer page while a print runs and goes back to page 1 when it ends:

alias: Office screen shows the printer
mode: restart
triggers:
  - trigger: state
    entity_id: sensor.printer_current_state
    to: "printing"
    id: printing
  - trigger: state
    entity_id: sensor.printer_current_state
    from: "printing"
    id: done
actions:
  - choose:
      - conditions:
          - condition: trigger
            id: printing
        sequence:
          - action: esphome.office_screen_show_page
            data:
              page: 3
      - conditions:
          - condition: trigger
            id: done
        sequence:
          - action: esphome.office_screen_show_page
            data:
              page: 1

Change office_screen to your screen's name, page: 3 to the number of your printer page, and the sensor and printing to the entity and state your printer's integration reports.

One thing to know: after a page is opened, Back to page 1 counts from that moment, the same as after a touch, so the screen goes back to page 1 on its own time. To keep the printer page up for the whole print, switch it off in the screen's settings, or let the automation turn switch.office_screen_back_to_page_1 off when the print starts and on again when it ends.

More about it in Open a page from an automation. I'll close this one, since it is already there, but tell me if something doesn't work the way you expect.


Got a screen running? Tell others which board you have and what works on the Tessera website. It helps everyone pick a screen that works.

Want me to keep building? Consider supporting monthly or buying me a coffee, much appreciated!

Original on GitHub

Schumey

A use case beyond showing a page: reading the page list

esphome.<screen>_show_page covers showing a page, thanks! What is still missing is the other way round: Home Assistant cannot find out which pages a screen has. I build Tessera Control, an integration that rotates a screen through its pages and brightens or dims it by situation. Today its users type in every page by hand (number and name), because neither the firmware's entities nor its actions tell Home Assistant how many pages there are or what they are called. The page layout lives only in the app's /data/screens.json.

Any one of these would be enough:

  1. A sensor on the screen, such as Pages, with the number of pages as its state and the titles as an attribute (pages: [{number: 1, title: "Home"}, …]).
  2. A text sensor with the titles in page order.
  3. A response from an action, for example ui_state returning the pages.

It should update when the layout is saved. Tessera Control would then add new pages and remove deleted ones by itself, and other automations could use page names instead of numbers.

Add your thoughts, a screenshot or a useful link.

Markdown & basic HTML
Paste or drop images Β· URLs on their own line become previews0 / 10,000
Create your account to join in

We need a verified email address to reach you about your contribution. Your address stays private.

Continue with GitHub

Your draft stays in this tab. Return here after verification.