Dollar Sign in Gauage Card

Is it possible to place the dollar sign in front of a value displayed in a gauge card?

I use the following template sensor to calculate the dollar value of energy used today (see example).

      - name: "Hot Tub Cost Today"
        unique_id: "hot_tub_cost_today"
        state: "{{(states('sensor.hot_tub_9_1d') | float * 0.16) | round(2) }}"

Screenshot 2024-03-15 181759

maybe this?

- name: "Hot Tub Cost Today"
        unique_id: "hot_tub_cost_today"
        state: "$ {{(states('sensor.hot_tub_9_1d') | float * 0.16) | round(2) [:1]}}"

Thank you for the suggestion. Unfortunately, the value won’t display in the gauge when I do that.
Screenshot 2024-03-16 113453

:thinking:

state: "${{(states('sensor.hot_tub_9_1d') | float * 0.16) | round(2) | replace('$', '')}}"

No go. Same message as above.

I believe this might do the deed.

- name: "Hot Tub Cost Today"
        unique_id: "hot_tub_cost_today"
        state: "{{'$'}}{{(states('sensor.hot_tub_9_1d') | float * 0.16) | round(2) }}"

Unfortunately, same message! Bummer.

i believe there’s no amount of mucking with the state that is going to succeed. the card relies upon the state being a number in order for it to place the needle in the gauge.

i think the primary avenue of hope would be if something like card_mod gave you a way to overlay text or an icon onto it, but i’m not an expert in card_mod.

1 Like