From 05060756e36086a2a0d94068357368821c11377b Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Sat, 10 Oct 2026 12:35:49 +0200 Subject: [PATCH] OpenPrintTag reader: filament color light falls back to the Creality tag --- mcu-rfid-openprinttag.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mcu-rfid-openprinttag.yaml b/mcu-rfid-openprinttag.yaml index 121c66b..43052b9 100644 --- a/mcu-rfid-openprinttag.yaml +++ b/mcu-rfid-openprinttag.yaml @@ -182,6 +182,9 @@ text_sensor: - platform: creality_cfs type: color name: Creality color + id: creality_color + on_value: + - script.execute: show_filament_color - platform: creality_cfs type: serial name: Creality serial @@ -197,9 +200,18 @@ text_sensor: - platform: openprinttag type: primary_color name: Color - # Mirrored to the filament_color light, empty = no tag + id: openprinttag_color on_value: + - script.execute: show_filament_color + +script: + # The filament color on the filament_color light: the OpenPrintTag's, else the Creality tag's + - id: show_filament_color + then: - lambda: |- + std::string x = id(openprinttag_color).state; + if (x.size() < 7) + x = id(creality_color).state; if (x.size() < 7) { id(filament_color).turn_off().set_transition_length(0).perform(); return;