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:
@@ -13,7 +13,8 @@
|
||||
# Requirements:
|
||||
# - Inovelli Blue Dimmer (VZM31-SN) paired with Zigbee2MQTT
|
||||
# - 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
|
||||
|
||||
@@ -71,8 +72,10 @@ action:
|
||||
current_index: "{{ available_modes.index(current_mode) }}"
|
||||
next_index: "{{ (current_index + 1) % (available_modes | length) }}"
|
||||
next_mode: "{{ available_modes[next_index] }}"
|
||||
mode_colors: "{{ states('input_text.adaptive_lighting_mode_colors') | from_json }}"
|
||||
next_color: "{{ mode_colors.get(next_mode, 170) }}"
|
||||
next_mode_settings_entity: >-
|
||||
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
|
||||
- service: input_select.select_option
|
||||
|
||||
Reference in New Issue
Block a user