From d2431f0ee698ebcf61789209a56d6637efc58ae8 Mon Sep 17 00:00:00 2001 From: isaacrushworth2002 <140648036+isaacrushworth2002@users.noreply.github.com> Date: Tue, 30 Dec 2025 12:27:24 +0000 Subject: [PATCH] Fix default sensor variables causing JS template errors The default values for motion_sensor, temp_sensor, and humid_sensor were set to the literal strings "variables.motion_sensor", "variables.temp_sensor", and "variables.humid_sensor" respectively. When a user doesn't provide these sensor variables (e.g. setting show_temp: false without a temp_sensor), the JavaScript template checks like `if (!variables.motion_sensor)` evaluate as truthy because they contain non-empty strings. This then causes the template to attempt `states["variables.motion_sensor"]` which throws: ButtonCardJSTemplateError: Cannot read properties of undefined (reading 'state') Changed the defaults to empty strings so the falsy checks work correctly when sensors aren't provided. --- dashboards/templates/button_cards/cards/homio_room.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboards/templates/button_cards/cards/homio_room.yaml b/dashboards/templates/button_cards/cards/homio_room.yaml index 3a0182f..d586c12 100644 --- a/dashboards/templates/button_cards/cards/homio_room.yaml +++ b/dashboards/templates/button_cards/cards/homio_room.yaml @@ -3,11 +3,11 @@ homio_room: - '[[[ return variables.motion_sensor ]]]' variables: show_motion: false - motion_sensor: variables.motion_sensor + motion_sensor: "" show_temp: false - temp_sensor: variables.temp_sensor + temp_sensor: "" show_humid: false - humid_sensor: variables.humid_sensor + humid_sensor: "" template: - homio_default tap_action: