Help with gauge and climate data

Hi

I have a question.
I have a thermometer in my hot water cylinder that is via TUYA.
It gives me the readings as ‘climate’ device.

I want to put this information into a gauge, but I cant select ‘climate’ device in gauge, only ‘temperature’ device. Is there a way (like the helpers for switches to lights/fans etc) to make an entity that turns the ‘climate’ temperature number into a ‘temperature’ number that i can use in the gauges?

Many thanks

Yes there is. A template sensor:

configuration.yaml:

template:
  - sensor:
      - name: "Temperature of Something"
        device_class: temperature
        state_class: measurement
        unit_of_measurement: "°C" # or F
        state: "{{ state_attr('cilmate.your_climate_entity_here', 'temperature') }}"
        availability: "{{ state_attr('cilmate.your_climate_entity_here', 'temperature')|is_number }}"

thank you for that.

I put it in, rebooted, but it keeps saying ‘sensor unavailable’

template:

  • sensor:
    • name: “Hot Water Temperature”
      device_class: temperature
      state_class: measurement
      unit_of_measurement: “°C”
      state: “{{ state_attr(‘cilmate.cylinder’, ‘temperature’) }}”
      availability: “{{ state_attr(‘cilmate.cylinder’, ‘temperature’)|is_number }}”

What does this return in Developer Tools → Templates?

{{ state_attr('cilmate.cylinder', 'temperature') }}

OK, i think i see the error ’ climate’ instead of ‘cilmate’
im just applying the 8.2 updates and im going to see if it plays after that.

Well that was a silly mistake. Sorry.

Thanks very much for your help - it has worked wonderfully ! i never really understood this before.
It would be so amazing if this could be done via HELPERS - im sure the principle is the same.

Template sensors aren’t really suited to “helpers”. They are far too diverse (and thus powerful). The simplest solution would be for gauge cards to support attributes. Other core cards have been given this support.

There’s a feature request here, (that is surprisingly similar to your use case) that you could vote for:

https://community.home-assistant.io/t/lovelace-ui-gauge-card-add-attribute-variable/311634