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

[BUG] The on_empty_queue event did not work #93

Closed
andrewjswan opened this issue Oct 2, 2023 · 18 comments
Closed

[BUG] The on_empty_queue event did not work #93

andrewjswan opened this issue Oct 2, 2023 · 18 comments
Labels
bug Something isn't working

Comments

@andrewjswan
Copy link

andrewjswan commented Oct 2, 2023

Bug report

Describe the bug

Yesterday started preparatory work to modify the source code to create Pull Request, flashed for the correct config 2023.9, specified as in the documentation:

  on_empty_queue:
    then:
      lambda: |-
        id(rgb8x32)->clock_screen(10,10);
        id(rgb8x32)->date_screen(10,5);

  on_start_running:
     then:
       lambda: |-
          id(rgb8x32)->clock_screen(10,10);
          id(rgb8x32)->date_screen(10,5);

Also from HA, the weather is constantly displayed on the screen. I.e. constant 3 screens, clock, date, weather (updated often because it is tied not only to the weather, but also to the temperature).
But this morning, there was only weather on the screen, no clock or date. It seems that the on_empty_queue event did not happen.

Additional information

  • used Hardware:
    • ESP32
    • EspHoMaTriXv2 version: 2023.9.0
@andrewjswan andrewjswan added the bug Something isn't working label Oct 2, 2023
@lubeda
Copy link
Owner

lubeda commented Oct 2, 2023

This night a had a similar effect :-(

@omia
Copy link

omia commented Oct 3, 2023

The on_empty_queue event should not happen. The queue was not empty. There was a screen in the queue.

@andrewjswan
Copy link
Author

That's understandable, what's not so clear is where the date and time disappeared to.

@omia
Copy link

omia commented Oct 3, 2023

They don't disappear. They are created with 10minutes of live.

On my clock the date and time disappear after around 10 minutes but they reappear randomly.

@omia
Copy link

omia commented Oct 3, 2023

I see two possible ways for this.

  1. A second queue for permanent screens which don't have a live time.
  2. Permanent screens should only be created within the clock(pulling data)

A would favor number 1.

@andrewjswan
Copy link
Author

Well, we basically have no screens that are permanent, since we already have at least two types of watches.
Here it is necessary either to constantly extend the life of the screen,

    this->endtime = this->clock->now().timestamp + 300;

or to set the minimum starting set, which is immortal.

@omia
Copy link

omia commented Oct 3, 2023

What is the differenz between a permanent screen and a immortal one?

@andrewjswan
Copy link
Author

Basically nothing, but we need to understand where the temporary screen is and where it is not, and when temporary can become permanent or vice versa.

@andrewjswan
Copy link
Author

We could try replacing the on_empty_queue event with on_expired_screen, then as soon as the clock becomes obsolete it can be returned :)

@omia
Copy link

omia commented Oct 9, 2023

How do we know which screen expired?

@andrewjswan
Copy link
Author

How do we know which screen expired?

Judging by the source code, the information about the screen is transmitted there, but we can not analyze it, just increase the life of the necessary screens, even by an hour, even by a day.

@lubeda
Copy link
Owner

lubeda commented Oct 9, 2023

Hi, on_expired_screen is the wrong approach! Since you decide with the lifetime-parameter how long a screen is alive.

My first implementation had a mandatory clock-screen, but some people wanted a normaly black-screen and only sometimes data to be displayed.

If you always wan't a clock in your queue you can' add e.g.:

  on_empty_queue:
    then:
      - lambda: |-
          id(rgb8x32).icon_clock("emptycal|day#1",1440,10,false); 

If you wan't a black screen you leave it empty.

@omia
Copy link

omia commented Oct 9, 2023

But if we have a weather screen running all the time even a life of a day will run out and the on_empty_screen should never be called.
What a about a on_screen_death event. So we can put a function as a parameter. This would even be a possibility to make it more generic. So a timer for example would make a sound on screen death.

@lubeda
Copy link
Owner

lubeda commented Oct 9, 2023

Besides the clock I don't understand the concept of permanent screens. For me, e.g. the wind speed is pushed with a lifetime of two minutes to the display by an automation that triggers on every state change. So the wind speed is "permanent" on the screen but totally controlled by home assistant. If you need something like a "motto of the day" set the lifetime to 24*60 minutes triggers by an automation on home assistant at 12p.m..

@andrewjswan
Copy link
Author

I have:

  on_empty_queue:
    then:
      lambda: |-
        id(rgb8x32)->clock_screen(1440,10);
        id(rgb8x32)->date_screen(1440,5);

And weather and temperature from HA, trigger state changes, lifetime 30 min

And a day, two days later, all I have is the weather on my screen. No clock or time

@andrewjswan
Copy link
Author

triggers by an automation on home assistant at 12p.m

I'd like to avoid that, it's an internal mechanism, I think HA is unnecessary.

@omia
Copy link

omia commented Oct 9, 2023

The problem can also happen without any "permanent" screens. Ad some point in time the clock screen dies. An if then any screen is in the queue the clock is gone.
And only if all screens are removed we get a trigger to renew the clock. So if we have homeassistant add 4 10min screens for fun things in the meantime we don't have the time on the clock.
Sometimes it can be bad timing but it's a clock it should tell the time.

@andrewjswan
Copy link
Author

Judging by the discussion it's not a bug, but that's how the queue works.
I think we should close this Issue, and open a new one about permanent screens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants