max13fr / Airzonecloud-HomeAssistant

Airzone Cloud plugin for Home Assistant
MIT License
28 stars 15 forks source link

Humidity not being recorded in history #16

Closed jd1900 closed 2 years ago

jd1900 commented 3 years ago

I can see target temperature and current temperature in the history tab: image

However, I can't see the current_humidity, despite being a valid attribute that is retrieved and that I can use: image

It would be great to be able to record it.

bvis commented 3 years ago

You can record it creating a new sensor from the obtained value, for example:

    - platform: template
      sensors:
        airzone_temperature_comedor:
          friendly_name: "Temperatura Comedor"
          value_template: "{{ state_attr('climate.airzone_comedor', 'current_temperature') }}"
          unit_of_measurement: "°C"
          device_class: "temperature"
        airzone_humidity_comedor:
          friendly_name: "Humedad Comedor"
          value_template: "{{ state_attr('climate.airzone_comedor', 'current_humidity') }}"
          unit_of_measurement: "%"
          device_class: "humidity"
gabrio79 commented 3 years ago

if you have Grafana, you can easily trend it without new sensors... SELECT mean("current_humidity") FROM "state" WHERE ("entity_id" = 'airzone_zone_name') AND $timeFilter GROUP BY time($__interval) fill(previous) other way, if you need only a quick overview, I use a lovelace markdown to have a compact view of all:

Screen Shot 2021-06-28 at 09 56 46 (Sorry but i am not able to format correctly)

< table>

    <tr>
      <th align="left"width="120">Zona</th>
      <th align="left"width="60">Modo</th>
      <th align="left" width="60">Temp </th>
      <th align="left" width="60">SetPoint</th>
      <th align="left"width="60">Hum %</th>
      <th align="left"width="60">Acceso</th>
    </tr>
<TR><TD>    Soggiorno   </TD><TD>   {{states('climate.casa_soggiorno')}}    </TD><TD>   {{ state_attr('climate.casa_soggiorno', 'current_temperature') }}°  </TD><TD>   {{ state_attr('climate.casa_soggiorno', 'temperature') }}°  </TD><TD>   {{ state_attr('climate.casa_soggiorno', 'current_humidity') }}% </TD><TD>   {%- if (is_state('climate.casa_soggiorno', 'heat'))  and  (state_attr('climate.casa_soggiorno', 'temperature') >  state_attr('climate.casa_soggiorno', 'current_temperature')+0.1) -%}  <ha-icon icon="mdi:fire"></ha-icon> {%- endif %} {%- if (is_state('climate.casa_soggiorno', 'cool'))  and  (state_attr('climate.casa_soggiorno', 'temperature') <  state_attr('climate.casa_soggiorno', 'current_temperature')-0.1) -%}   <ha-icon icon="mdi:snowflake"></ha-icon>  {%- endif %}</TD></TR>
<TR><TD>    Studio  </TD><TD>   {{states('climate.casa_studio')}}   </TD><TD>   {{ state_attr('climate.casa_studio', 'current_temperature') }}° </TD><TD>   {{ state_attr('climate.casa_studio', 'temperature') }}° </TD><TD>   {{ state_attr('climate.casa_studio', 'current_humidity') }}%    </TD><TD>   {%- if (is_state('climate.casa_studio', 'heat'))  and  (state_attr('climate.casa_studio', 'temperature') >  state_attr('climate.casa_studio', 'current_temperature')+0.1) -%}  <ha-icon icon="mdi:fire"></ha-icon> {%- endif %} {%- if (is_state('climate.casa_studio', 'cool'))  and  (state_attr('climate.casa_studio', 'temperature') <  state_attr('climate.casa_studio', 'current_temperature')-0.1) -%}   <ha-icon icon="mdi:snowflake"></ha-icon>  {%- endif %}</TD></TR>
<TR><TD>    Bagno   </TD><TD>   {{states('climate.casa_bagno_princ')}}  </TD><TD>   {{ state_attr('climate.casa_bagno_princ', 'current_temperature') }}°    </TD><TD>   {{ state_attr('climate.casa_bagno_princ', 'temperature') }}°    </TD><TD>   {{ state_attr('climate.casa_bagno_princ', 'current_humidity') }}%   </TD><TD>   {%- if (is_state('climate.casa_bagno_princ', 'heat'))  and  (state_attr('climate.casa_bagno_princ', 'temperature') >  state_attr('climate.casa_bagno_princ', 'current_temperature')+0.1) -%}  <ha-icon icon="mdi:fire"></ha-icon> {%- endif %} {%- if (is_state('climate.casa_bagno_princ', 'cool'))  and  (state_attr('climate.casa_bagno_princ', 'temperature') <  state_attr('climate.casa_bagno_princ', 'current_temperature')-0.1) -%}   <ha-icon icon="mdi:snowflake"></ha-icon>  {%- endif %}</TD></TR>
<TR><TD>    Camera  </TD><TD>   {{states('climate.casa_cameretta')}}    </TD><TD>   {{ state_attr('climate.casa_cameretta', 'current_temperature') }}°  </TD><TD>   {{ state_attr('climate.casa_cameretta', 'temperature') }}°  </TD><TD>   {{ state_attr('climate.casa_cameretta', 'current_humidity') }}% </TD><TD>   {%- if (is_state('climate.casa_cameretta', 'heat'))  and  (state_attr('climate.casa_cameretta', 'temperature') >  state_attr('climate.casa_cameretta', 'current_temperature')+0.1) -%}  <ha-icon icon="mdi:fire"></ha-icon> {%- endif %} {%- if (is_state('climate.casa_cameretta', 'cool'))  and  (state_attr('climate.casa_cameretta', 'temperature') <  state_attr('climate.casa_cameretta', 'current_temperature')-0.1) -%}   <ha-icon icon="mdi:snowflake"></ha-icon>  {%- endif %}</TD></TR>
<TR><TD>    Greta   </TD><TD>   {{states('climate.casa_cameragreta')}}  </TD><TD>   {{ state_attr('climate.casa_cameragreta', 'current_temperature') }}°    </TD><TD>   {{ state_attr('climate.casa_cameragreta', 'temperature') }}°    </TD><TD>   {{ state_attr('climate.casa_cameragreta', 'current_humidity') }}%   </TD><TD>   {%- if (is_state('climate.casa_cameragreta', 'heat'))  and  (state_attr('climate.casa_cameragreta', 'temperature') >  state_attr('climate.casa_cameragreta', 'current_temperature')+0.1) -%}  <ha-icon icon="mdi:fire"></ha-icon> {%- endif %} {%- if (is_state('climate.casa_cameragreta', 'cool'))  and  (state_attr('climate.casa_cameragreta', 'temperature') <  state_attr('climate.casa_cameragreta', 'current_temperature')-0.1) -%}   <ha-icon icon="mdi:snowflake"></ha-icon>  {%- endif %}</TD></TR>
<TR><TD>    Lavanderia  </TD><TD>   {{states('climate.casa_lavanderia')}}   </TD><TD>   {{ state_attr('climate.casa_lavanderia', 'current_temperature') }}° </TD><TD>   {{ state_attr('climate.casa_lavanderia', 'temperature') }}° </TD><TD>   {{ state_attr('climate.casa_lavanderia', 'current_humidity') }}%    </TD><TD>   {%- if (is_state('climate.casa_lavanderia', 'heat'))  and  (state_attr('climate.casa_lavanderia', 'temperature') >  state_attr('climate.casa_lavanderia', 'current_temperature')+0.1) -%}  <ha-icon icon="mdi:fire"></ha-icon> {%- endif %} {%- if (is_state('climate.casa_lavanderia', 'cool'))  and  (state_attr('climate.casa_lavanderia', 'temperature') <  state_attr('climate.casa_lavanderia', 'current_temperature')-0.1) -%}   <ha-icon icon="mdi:snowflake"></ha-icon>  {%- endif %}</TD></TR>
<TR><TD>    Matrimoniale    </TD><TD>   {{states('climate.casa_camera_mat')}}   </TD><TD>   {{ state_attr('climate.casa_camera_mat', 'current_temperature') }}° </TD><TD>   {{ state_attr('climate.casa_camera_mat', 'temperature') }}° </TD><TD>   {{ state_attr('climate.casa_camera_mat', 'current_humidity') }}%    </TD><TD>   {%- if (is_state('climate.casa_camera_mat', 'heat'))  and  (state_attr('climate.casa_camera_mat', 'temperature') >  state_attr('climate.casa_camera_mat', 'current_temperature')+0.1) -%}  <ha-icon icon="mdi:fire"></ha-icon> {%- endif %} {%- if (is_state('climate.casa_camera_mat', 'cool'))  and  (state_attr('climate.casa_camera_mat', 'temperature') <  state_attr('climate.casa_camera_mat', 'current_temperature')-0.1) -%}   <ha-icon icon="mdi:snowflake"></ha-icon>  {%- endif %}</TD></TR>
<TR><TD>    Bagentto    </TD><TD>   {{states('climate.casa_bagnocamera')}}  </TD><TD>   {{ state_attr('climate.casa_bagnocamera', 'current_temperature') }}°    </TD><TD>   {{ state_attr('climate.casa_bagnocamera', 'temperature') }}°    </TD><TD>   {{ state_attr('climate.casa_bagnocamera', 'current_humidity') }}%   </TD><TD>   {%- if (is_state('climate.casa_bagnocamera', 'heat'))  and  (state_attr('climate.casa_bagnocamera', 'temperature') >  state_attr('climate.casa_bagnocamera', 'current_temperature')+0.1) -%}  <ha-icon icon="mdi:fire"></ha-icon> {%- endif %} {%- if (is_state('climate.casa_bagnocamera', 'cool'))  and  (state_attr('climate.casa_bagnocamera', 'temperature') <  state_attr('climate.casa_bagnocamera', 'current_temperature')-0.1) -%}   <ha-icon icon="mdi:snowflake"></ha-icon>  {%- endif %}</TD></TR>
  </table>
jd1900 commented 3 years ago

Thank you both.

I finally opted for the @gabrio79 option with grafana.

However, in the acceso column, I guess there is something missing in between the if. Maybe the icon that is not properly got in github? Do you set up there the unicode character for cold/warm?

gabrio79 commented 3 years ago

Could be... `
{%- if (is_state('climate.casa_bagnocamera', 'heat')) and (state_attr('climate.casa_bagnocamera', 'temperature') > state_attr('climate.casa_bagnocamera', 'current_temperature')+0.1) -%}

    {%- endif %}
    {%- if (is_state('climate.casa_bagnocamera', 'cool'))  and  (state_attr('climate.casa_bagnocamera', 'temperature') <  state_attr('climate.casa_bagnocamera', 'current_temperature')-0.1) -%}
        <ha-icon icon="mdi:snowflake"></ha-icon>
    {%- endif %}

`

it seems removed <ha-icon icon="mdi:fire"></ha-icon> and similar

I update the code