Home Assistant Calendar from sensor
This automation sends the current date and day of the month to Awtrix clocks using themed colors based on the current month. It updates whenever `sensor.date` changes.
About this flow
| System | Home Assistant |
|---|---|
| AWTRIX version | AWTRIX 3 |
| Topic | Smarthome |
| Built by | Colton Dick |
| File | GYpgowRyAZE0.yaml · 1.3 KB |
| Icons | — |
| Published | 13 Oct 2024 |
| Downloads | 21 |
Is this your flow?
If you created this flow, open your saved edit link to add it to your account. You can then manage it whenever you sign in. Adding it to your account replaces the edit link.
The automation "Awtrix: Send Current Date to Awtrix Clocks with Color Themes" triggers whenever the sensor.date entity changes. It formats the current day of the month and the full date (e.g., "OCT 13") and sends this information to the Awtrix clocks (awtrix_clock_1) using MQTT. The date is displayed in a color scheme that corresponds to the current month’s theme (e.g., blue for January, pink for February, red for December). The day of the month is drawn in black, while the formatted date is colored according to the month’s theme. This ensures a visually appealing display based on seasonal events like Christmas, Halloween, or summer.
GYpgowRyAZE0.yaml
- id: "76b5be94-b91e-4765-94e9-8f43e859b5aa"
alias: "Awtrix: Send Current Date to Awtrix Clocks with Color Themes"
trigger:
# Trigger whenever sensor.date changes
- platform: state
entity_id: sensor.date
action:
# Set the current day and date
- service: mqtt.publish
data:
topic: "awtrix_clock_1/custom/calendar"
payload: >
{% set current_day = states('sensor.date')[8:10] %}
{% set current_month = now().month %}
{% set current_date = now().strftime('%b %d').upper() %}
{% set color = {
1: '#42A5F5',
2: '#E91E63',
3: '#4CAF50',
4: '#00BCD4',
5: '#FFEB3B',
6: '#FF9800',
7: '#F44336',
8: '#00E5FF',
9: '#FFC107',
10: '#FF5722',
11: '#795548',
12: '#FF1744'
}[current_month] %}
{
"draw": [
{"df": [0,2,9,7, "#FFFFFF"]},
{"df": [0,0,9,2, "#FF0000"]},
{"dt": [1, 2, "{{current_day}}", "#000000"]},
{"dt": [10, 1, "{{current_date}}", "{{color}}"]}
],
"pos": 1
}
qos: 0
retain: false
More flows for Home Assistant or Smarthome
Something wrong with this flow? Report it.