This flow was submitted before accounts existed, so nobody owns it yet. If you submitted it, open the edit link you were given — it still works — and you can attach the flow to an account from there. There is no deadline, and attaching it retires the link for good.
Year progress
Shows the current progress of the year in %. You only have to update the MQTT topic.
| System | Home Assistant |
|---|---|
| Firmware | AWTRIX 3 |
| Topic | Miscellaneous |
| Built by | DezeStijn |
| File | jyNg0oGXOX6D.yaml · 1.2 KB |
| Icons | 1 |
| Published | 2 Jun 2023 · updated 6 Jun 2023 |
| Downloads | 40 |
Gets the current year progress between yyyy-01-01T00:00:00.000000 and yyyy-12-31T23:59:59.999999.
Reports in % (rounded down to 0 decimals).
Based on blueforcer's Node-RED flow.
https://gist.github.com/TheGroundZero/aee170c693b04b79e9ebf95ffcd9004f
jyNg0oGXOX6D.yaml
automation:
- id: awtrix_year_progress
alias: Year Progress
description: Publishes the current year progress in % to the Awtrix clock
trigger:
- platform: time_pattern
hours: "*"
minutes: 0
condition: []
action:
- service: mqtt.publish
data:
payload: >-
{# Get current timestamp #}
{%- set now = now() -%}
{# Start of current year #}
{%- set startOfYear = now.replace(year=now.year, month=1, day=1, hour=0, minute=0, second=0, microsecond=0) -%}
{# Determine end of current year #}
{%- set endOfYear = startOfYear.replace(month=12, day=31, hour=23, minute=59, second=59, microsecond=999999) -%}
{# Calculate progress #}
{%- set total = as_timestamp(endOfYear) - as_timestamp(startOfYear) -%}
{%- set current = as_timestamp(now) - as_timestamp(startOfYear) -%}
{%- set progress = ( current / total * 100 ) | round(0, "floor", 0) -%}
{# Output #}
{ "text": "{{ progress }} %", "icon": "y2023"}
topic: awtrix_dd2824/custom/yearprogress
qos: 0
retain: false
mode: single
These icons belong on the device, in /ICONS. Each one is at
most 32×8
pixels — shown here magnified, at their real proportions.
8×8 px
More flows for Home Assistant or Miscellaneous
Something wrong with this flow? Report it.