Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106320

Help with dynamic template card and input select

$
0
0

Home Assistant 0.114.2

Hey all,
need some help with how to get the values and use it within a “vars” (array?)

Background:
i have 10 rooms, however, i dont want to create new cards for each of these rooms - im looking to have something a bit more lean, where you can pick a room and then the room you pick, will populate the data into the card, for use.

Eg. if i select “living room” from a drop down, then the graph would show the values for the living room data. Then if you pick “kitchen” the graph would then update again.

Ive been playing with the config-template-card, however im not sure how to get my value to pass in, from my input select?

input select:
  room_temp_display:
    name: Display Room Temp Info
    options:
      - Office
      - Living
      - Kitchen
    initial: Office

so if i pick “office” it would use the value “sensor.average_temp_jamie_office”

card:
  entities:
    - '${vars[0] === ''Office'' ? ''sensor.average_temp_jamie_office''': 'vars[0] === ''Living'' ? ''sensor.average_temp_living_room'' }'
  type: 'custom:mini-graph-card'
entities:
  - input_select.room_temp_display
type: 'custom:config-template-card'
variables:
  - 'states[''input_select.room_temp_display''].state'

here we can see the state of the card, jsut on its own (as a working graph example)

entities:
  - sensor.average_temp_jamie_office
type: 'custom:mini-graph-card'

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106320

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>