home-assistant / ui-schema

A schema to define a user interface for Home Assistant.
Apache License 2.0
41 stars 6 forks source link

Feature request - nestable state_image #102

Closed DubhAd closed 6 years ago

DubhAd commented 6 years ago

There are a number of times it would be useful to nest the state images, to allow different images for (say) day and night, and lights on or off, without having to resort to input_selects and automations.

Like you can nest the horizontal and vertical stacks, something like:

  state_image:
    "below_horizon": 
      state_image:
        "on": /local/living_room_night_on.png
        "off": /local/living_room_night_off.png
      entity: group.living.room
    "above_horizon": /local/living_room_day.png
  entity_id: sun.sun
ciotlosm commented 6 years ago

Maybe avoid nesting as it makes it a bit unreadable

state_image:
  - image: /local/living_room_day.png
    match:
      sun.sun: above_horizon
  - image: /local/living_room_night_on.png
    match:
      sun.sun: below_horizon
      group.living.room: on
  - image: /local/living_room_night_off.png
    match:
      sun.sun: below_horizon
      group.living.room: off
c727 commented 6 years ago

Imo this is too much and we try to implement something like a template engine here

balloob commented 6 years ago

I agree with c727. We should try to keep the configuration simple. If we don't, we will also kill any possibility for a UI.

c727 commented 6 years ago

Yep, if you need something complex use a template sensor