hass-kumo
hass-kumo copied to clipboard
Expose sensor Entity for each Climate Object
It would be great if the hass-kumo integration could expose a sensor entity for each climate entity that it exposes - basically just a sensor that tracks the climate.*.current_temperature
value.
You can create a template sensor to accomplish what you're suggesting. Here's the code I use:
sensor:
- platform: template
sensors:
temperature_family_room_template:
friendly_name: "Family Room Temperature"
value_template: "{{state_attr('climate.family_room','current_temperature')|float}}"
That's what I did. I just think it would be a nice thing to include "out of the box."
Definitely a "nice-to-have" feature request.
Yeah, it's on the wishlist. I would accept a pull request but am unlikely to work on it myself.
You'll note the README actually calls out using template sensors for this purpose; indeed there are some attributes exposed on the Climate entity to be used like this.
I'll see if I can put something together at some point...
This is what I actually ended up with in my config; I needed to add the {%- if state_attr('climate.office', 'current_temperature') != None %}
to correctly handle the current_temperature disappearing and the sensor going to 0 when issuing commands to the units:
master_bedroom_temperature:
friendly_name: "Master Bedroom Temperature"
value_template: >-
{%- if state_attr('climate.master', 'current_temperature') != None %}
{{state_attr('climate.master','current_temperature')|float}}
{%- endif %}
unit_of_measurement: '°F'
availability_template: >-
{%- if not is_state('climate.master', 'unavailable') %}
true
{%- endif %}
You also need to remove your double-quotes, @jhuang0, or you end up with "76.0" as a string instead of 76.0
the float.
With those two changes, my temperature history now appears to be working.
I just submitted a PR for this: https://github.com/dlarrick/hass-kumo/pull/113
This is merged, released in v0.3.7-beta. Assuming no issues I'll promote to stable in a week or so.