Update Inovelli mode cycling blueprint to use nested schema

Replace reference to deleted adaptive_lighting_mode_colors entity with
convention-based mode settings lookup. The blueprint now extracts led_color
from each mode's nested JSON schema (input_text.adaptive_lighting_settings_{{mode}})
instead of using a separate color mapping entity.

This fixes the error:
"ValueError: Template error: from_json got invalid input 'unknown' when
rendering template '{{ states('input_text.adaptive_lighting_mode_colors') | from_json }}'"
This commit is contained in:
2025-12-21 18:03:52 -08:00
parent 16319e5bc4
commit 6f612787a1

View File

@@ -13,7 +13,8 @@
# Requirements: # Requirements:
# - Inovelli Blue Dimmer (VZM31-SN) paired with Zigbee2MQTT # - Inovelli Blue Dimmer (VZM31-SN) paired with Zigbee2MQTT
# - input_select helper with available modes # - input_select helper with available modes
# - packages/adaptive_lighting_global.yaml for mode colors # - Mode settings entities following convention: input_text.adaptive_lighting_settings_{{mode}}
# - Each mode must have led_color field in nested JSON schema
# #
# Reference: ADAPTIVE_LIGHTING_CONTROL_SYSTEM_DESIGN.md lines 144-182 # Reference: ADAPTIVE_LIGHTING_CONTROL_SYSTEM_DESIGN.md lines 144-182
@@ -71,8 +72,10 @@ action:
current_index: "{{ available_modes.index(current_mode) }}" current_index: "{{ available_modes.index(current_mode) }}"
next_index: "{{ (current_index + 1) % (available_modes | length) }}" next_index: "{{ (current_index + 1) % (available_modes | length) }}"
next_mode: "{{ available_modes[next_index] }}" next_mode: "{{ available_modes[next_index] }}"
mode_colors: "{{ states('input_text.adaptive_lighting_mode_colors') | from_json }}" next_mode_settings_entity: >-
next_color: "{{ mode_colors.get(next_mode, 170) }}" input_text.adaptive_lighting_settings_{{ next_mode | lower | replace(' ', '_') }}
next_mode_settings: "{{ states(next_mode_settings_entity) | from_json }}"
next_color: "{{ next_mode_settings.led_color | default(170) }}"
# Change to next mode # Change to next mode
- service: input_select.select_option - service: input_select.select_option