-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AWTRIX does not render integers or numeric sensor data in YAML templates #618
Comments
What does the JSON structure that is sent to Awtrix look like? |
That's not a Bug. So it should be
To make sure it is a string use
|
Hi, @Blueforcer, when using the code you provided:
It still fails to render the text. 🤖 Home Assistant Automation
This automation uses a third-party library: 10der/homeassistant-custom_components-awtrix alias: Awtrix Steps
description: ""
triggers:
- trigger: state
entity_id:
- sensor.google_pixel_watch_daily_steps_4
- trigger: time_pattern
minutes: "14"
conditions: []
actions:
- action: awtrix.awtrix_2d8db4_push_app_data
data:
name: Steps
data:
text: >
{% set steps = states('sensor.google_pixel_watch_daily_steps_4') |
string %} {{ steps }}
icon: "30415"
duration: 0
pushIcon: 0
lifetime: 900
repeat: 1
mode: single |
The problem is most certainly caused by the way the text is sent to the publish order, it's lost somewhere. |
Bug report
Describe the bug
AWTRIX fails to render integer values (such as sensor data) when the output consists solely of a number. However, when appending a non-numeric character (e.g., a space, letter, or symbol), AWTRIX renders the value correctly.
Additional information
To Reproduce
Steps to reproduce the behavior:
Expected behavior
AWTRIX should render the integer (e.g.,
5000
) directly without requiring any additional characters.Screenshots
Logs
No logs
Workaround
Appending an invisible character (like a zero-width space) or a visible symbol to the output forces AWTRIX to display the numeric value.
Example working code:
Additional context
This bug seems related to how AWTRIX processes or parses numeric values in YAML templates. It treats numeric-only outputs as invalid and doesn’t render them unless a non-numeric character is appended.
The text was updated successfully, but these errors were encountered: