Skip to content

Changing the image dynamically #354

Answered by jn3va
jn3va asked this question in Q&A
Jun 18, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I've solved this using the custom-button card and setting the triggers-update to all.

In the custom card template I use

        type: custom:apexcharts-card
        apex_config:
          plotOptions:
            radialBar:
              hollow:
                margin: 2
                image: "[[[ return states[variables.weather_icon_path].state ]]]"
                imageWidth: 140
                imageHeight: 140
                imageClipped: false

In the dashboard yaml

    variables:
      weather_icon_path: "input_text.weather_icon_path"

Once I added in the custom button
triggers_update: all
The input_text contains a path like:

/local/images/sunny/png

When I change the value of t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RomRider
Comment options

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