Skip to content

Conditional Element #214

Answered by OzGav
shieldsit asked this question in Q&A
Mar 25, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Yes you can use a template sensor to extract the required value or to set a flag using a binary_sensor. For example:

      rumpus_app_name:
        value_template: >
          {% if is_state('media_player.kodi', 'playing') %} 
            kodi
          {% elif is_state('media_player.rumpus_tv', 'playing') %}
            {{ (state_attr("media_player.rumpus_tv", "app_name")) }}
          {% else %}
            off
          {% endif %}

then use that to set the image in floorplan

            - name: Media Player App Icon
              entities:
                - sensor.rumpus_app_name
                - sensor.livingroom_app_name
              state_action:
                service: floorpla…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@exetico
Comment options

@exetico
Comment options

@shieldsit
Comment options

Answer selected by exetico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants