EspHoMaTriXv2, lost in automation

Hi there,

I ve installed EspHoMaTriXv2 on a TC001 display, and i wanted to endlessly display 5 sensor values, each one displayed during 15s.

I’ve set up an automation (see below) that makes 5 services calls (for each value to display) every 2 minutes, with a lifetime of 1 minute and a display time of 15s.

It works but sometimes one of the 5 screens isn’t displayed or is displayed very shortly, being replaced by the next).

I’m not sure to clearly understand how EspHoMaTriXv2 loop works.

  • Does a screen with a lifetime of 1 minutes really disappear 1 minutes after enqueuing?
  • What happens if a screen is still on queue if a similar screen is enqueued (with next automation triggering)?
  • is there a way to know how many screens are currently in queue?

My automation, if useful, is below. Thx by advance for your advices.

S.

alias: TC001-LR routine
description: ""
trigger:
  - platform: time_pattern
    minutes: /2
condition: []
action:
  - service: esphome.tc001_lr_icon_screen
    data:
      default_font: true
      r: 0
      g: 255
      b: 255
      icon_name: intemp
      lifetime: 1
      screen_time: 15
      text: "{{states('sensor.0xa4c138788cb24c7c_temperature')}}°"
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: esphome.tc001_lr_icon_screen
    data:
      default_font: true
      r: 0
      g: 255
      b: 255
      icon_name: outtemp
      lifetime: 1
      screen_time: 5
      text: "{{states('sensor.0xa4c1386702c976a0_temperature')}}°"
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: esphome.tc001_lr_icon_screen
    data:
      default_font: true
      r: 0
      g: 255
      b: 255
      icon_name: humidity
      lifetime: 1
      screen_time: 5
      text: "{{states('sensor.0xa4c138788cb24c7c_humidity', with_unit=True)}}"
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: esphome.tc001_lr_icon_screen
    data:
      default_font: true
      r: 0
      g: 255
      b: 255
      icon_name: power
      lifetime: 1
      screen_time: 15
      text: "{{states('sensor.lixee_papp')}}W"
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: esphome.tc001_lr_icon_screen
    data:
      default_font: true
      r: 0
      g: 255
      b: 255
      icon_name: power
      lifetime: 1
      screen_time: 15
      text: "{{states('sensor.conso_totale_j') | round(0)}}kWh"
mode: single

If I was you I would post your question on the original thread. The author seems to monitor that closely.

Hi,

Does a screen with a lifetime of 1 minutes really disappear 1 minutes after enqueuing?

Yes, I think your lifetime should be 2 minutes like the interval of your automation

What happens if a screen is still on queue if a similar screen is enqueued (with next automation triggering)?

The screen stays in the loop, but the new data is displayed, and its lifetime is “renewed”

** is there a way to know how many screens are currently in queue?**

No, and why? If you want a screen to be displayed, use alert_screen By the way, there is a get_status service which lists all screens to the log.

To optimize your solution:

Trigger your automation by sensor change and not by time and make the lifetime per screen longer. the visual result is the same but depending on your sensors less load on the host.

Something like I sketched here:

alias: test
description: "example"
trigger:
  - platform: state
    entity_id:
      - sensor.bambu_x1c_bed_temperature
    id: print3d
  - platform: state
    entity_id:
      - sensor.lumi_lumi_sensor_switch_aq2_device_temperature
    id: devicetemp
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - print3d
        sequence:
          - service: esphome.m5mic_icon_screen
            data:
              default_font: true
              icon_name: print3d
              text: "{{states('sensor.0xa4c138788cb24c7c_temperature')}}°"
              lifetime: 10
              screen_time: 15
              r: 200
              g: 200
              b: 200
      - conditions:
          - condition: trigger
            id:
              - devicetemp
        sequence:
          - service: esphome.m5mic_icon_screen
            data:
              default_font: false
              icon_name: temp
              text: "{{states('sensor.0xa4c138788cb24c7c_temperature')}}°"
              lifetime: 10
              screen_time: 15
              r: 200
              g: 200
              b: 200
mode: queued