I am not completely sure where to post this, i hope this is ok. I have an Ulanzi Awtrix flashed with Awtrix Light connected to my HA via mqtt and on occasion i use this custom flow to display timers: AWTRIX Flows
Now, i tried modifing it so it only displays hours and minutes (HH:mm) instead of hours, minutes and seconds (HH:mm:ss). But i was unsuccessfull so far. Maybe someone can help me out?
If you don’t like clicking links, here’s the code:
alias: ⏳AWTRIX Timer
description: ""
trigger:
- platform: state
entity_id:
- timer.awtrix_timer
to: active
id: start
- platform: state
entity_id:
- timer.awtrix_timer
to: idle
id: stop
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- start
sequence:
- parallel:
- repeat:
sequence:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: awtrix_a8ba90/custom/timer
payload: >
{% set duration =
as_timedelta(state_attr('timer.awtrix_timer',
'duration')).total_seconds() %} {% set remaining =
as_datetime(state_attr(trigger.entity_id,
'finishes_at')) - now().replace(microsecond=0) %} {%
set passed = duration - remaining.total_seconds() %}
{% set progress = ((passed/duration) * 100) | round(0)
| int %} {{
dict(
icon = '42893',
text = remaining | string,
progress = progress,
progressC = '#ff0000',
progressBC = '#000000'
)
}}
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
while:
- condition: state
entity_id: timer.awtrix_timer
state: active
- service: mqtt.publish
data:
qos: 0
retain: false
topic: awtrix_a8ba90/settings
payload: "{\"ATRANS\": false}"
- repeat:
count: 1
sequence:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: awtrix_a8ba90/switch
payload: "{\"name\":\"timer\"}"
- conditions:
- condition: trigger
id:
- stop
sequence:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: awtrix_a8ba90/sound
payload: "{\"sound\":\"short\"}"
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- parallel:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: awtrix_a8ba90/custom/timer
- service: mqtt.publish
data:
qos: 0
retain: false
topic: awtrix_a8ba90/settings
payload: "{\"ATRANS\": true}"
mode: restart