diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 1b2db1de..7b17f842 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -3859,6 +3859,14 @@ trigger_variables: group05: !input utilities_page01_group05_line_reference group06: !input utilities_page01_group06_line_reference + sun_entity: !input sun_entity + sun_is_up: > + {{ + is_state(sun_entity, "above_horizon") + if sun_entity is string and sun_entity.split("sun.") | count == 2 and has_value(sun_entity) + else true + }} + variables: blueprint_version: 4.4.0.dev6 pages: @@ -4584,8 +4592,8 @@ triggers: event_data: entity_id: !input weather_entity - id: sun_state_change # Sun changed - trigger: state - entity_id: !input sun_entity + trigger: template + value_template: '{{ sun_is_up }}' - triggers: # Others - id: qrcode_changed # QR Code changed @@ -4711,27 +4719,6 @@ actions: else "%A, " ~ date_format_temp }} - sun_entity_input: !input sun_entity - sun_entity: > - {{ - sun_entity_input - if - sun_entity_input is string and - sun_entity_input.split("sun.") | count == 2 - else - ( - (states.sun | map(attribute="entity_id") | list | first) - if states.sun | selectattr("entity_id", "defined") | list | count > 0 - else None - ) - }} - sun_is_up: > - {{ - is_state(sun_entity, "above_horizon") - if sun_entity is string and sun_entity.split("sun.") | count == 2 and has_value(sun_entity) - else true - }} - # yamllint disable rule:line-length rule:braces device_class_icons: cover: { "awning-closed": "window-closed", "awning-closing": "arrow-down-box", "awning-open": "window-open", "awning-opening": "arrow-up-box", "blind-closed": "blinds-horizontal-closed", "blind-closing": "arrow-down-box", "blind-open": "blinds-horizontal", "blind-opening": "arrow-up-box", "curtain-closed": "curtains-closed", "curtains-closing": "arrow-collapse-horizontal", "curtains-open": "curtains-open", "arrow-split-vertical": "curtains-open", "damper-closed": "circle-slice-8", "damper-closing": "circle", "damper-open": "circle", "damper-opening": "circle", "door-closed": "door-closed", "door-closing": "door-open", "door-open": "door-open", "door-opening": "door-open", "garage-closed": "garage", "garage-closing": "arrow-down-box", "garage-open": "garage-open", "garage-opening": "arrow-up-box", "gate-closed": "gate", "gate-closing": "gate-arrow-right", "gate-open": "gate-open", "gate-opening": "gate-arrow-left", "shade-closed": "roller-shade-closed", "shade-closing": "arrow-down-box", "shade-open": "roller-shade", "shade-opening": "arrow-up-box", "shutter-closed": "window-shutter", "shutter-closing": "arrow-down-box", "shutter-open": "window-shutter-open", "shutter-opening": "arrow-up-box", "window-closed": "window-closed", "window-closing": "arrow-down-box", "window-open": "window-open", "window-opening": "arrow-up-box" }