lubeda / EsphoMaTrix

A simple DIY status display with an 8x32 RGB LED panel implemented with esphome.io and Home Assistant
MIT License
217 stars 23 forks source link

Feature Request: Update screen immediately on force screen #49

Closed jd1 closed 1 year ago

jd1 commented 1 year ago

It would be nice if the screen would update immediately when you call force screen. E.g. I would like to show the current caller on my landline phone and it is annoying if I have to wait until the screen moves to the next to see the caller.

If you would like to keep the current behaviour, you could also split it up in two methods:

It's been over half a year since I had a deeper look at the code, so I'm not sure how much effort this is. This is just an idea for an improvement, no show stopper :)

lubeda commented 1 year ago

Hi, take a look at the branch 2023.3.3, this should fix it!

jd1 commented 1 year ago

That's a nice fix 👍 I didn't test it yet, but the code looks good.

lubeda commented 1 year ago

i tested it, its included in the latest 2023.3.3 release

jrspowers commented 1 year ago

hello @lubeda if add this to the config for ulanzi it stays red it is still missing something in the config of the hold screen but can't find the service setting anywhere?

binary_sensor:
  - platform: gpio
    pin:
      number: $right_button_pin
      inverted: true
    on_press:
      lambda:
        id(rgb8x32)->hold_screen();
lubeda commented 1 year ago

Are you on the latest version? ->hold_screen(); was introduced. just some hours ago?

The text of the error could help.

jrspowers commented 1 year ago

i never have to do anything when you release update work all good of new things ? so hence this question?

jrspowers commented 1 year ago

@lubeda i know what the problem was forgetting to put the name in & what does the hold_screen mean to stay on that screen for 20 sec?

jrspowers commented 1 year ago

@lubeda the hold screen function can this also be infinitely set so that you always only see your clock? or e.g. youtube subscribers?

lubeda commented 1 year ago

to only show e.g. the youtubesubscribers, i recommend: disable the clockdisplay

esphome:
  on_boot:
    then:
      - ds1307.read_time:
      - lambda:
         id(rgb8x32)->set_clock_time(0);

read the value from home assistant

sensor:
  - platform: homeassistant
    name: "Github sensor from home assistant"
    id: sgithub
    entity_id: sensor.lubeda_esphomatrix_stars
    on_value:
      lambda: 
        ESP_LOGI("github", "Value is %f", id(sgithub)->state);

refresh the display every minute

time:
  - platform: ds1307
    id: ehmtx_time
    on_time:
      - seconds: 0
        minutes: /1
        then: 
          lambda: |-
            char text[20];
            sprintf(text,"%10.0f", id(sgithub).state);
            id(rgb8x32)->add_screen("github", text, 2,61, false);      

Only the subscriber count comes from homeassistant the rest is only in the esphome yaml.

jrspowers commented 1 year ago

to only show e.g. the youtubesubscribers, i recommend:

disable the clockdisplay


esphome:

  on_boot:

    then:

      - ds1307.read_time:

      - lambda:

         id(rgb8x32)->set_clock_time(0);

read the value from home assistant


sensor:

  - platform: homeassistant

    name: "Github sensor from home assistant"

    id: sgithub

    entity_id: sensor.lubeda_esphomatrix_stars

    on_value:

      lambda: 

        ESP_LOGI("github", "Value is %f", id(sgithub)->state);

refresh the display every minute


time:

  - platform: ds1307

    id: ehmtx_time

    on_time:

      - seconds: 0

        minutes: /1

        then: 

          lambda: |-

            char text[20];

            sprintf(text,"%10.0f", id(sgithub).state);

            id(rgb8x32)->add_screen("github", text, 2,61, false);      

Only the subscriber count comes from homeassistant the rest is only in the esphome yaml.

yes okay good but if I now want it to work again I want to switch it on with the middle button, for example 1 click & 2 clicks to turn it off, is that possible? in this way ?

lubeda commented 1 year ago

with esphome everything is possible! But this logic does not belong to my component. I would suggest on the first click to use add_screen with a long screen time and on the second click a del_screen. But that is up to your choice.