MeacoDry Arete® Two 18L Dehumidifier support

Hi!

Template code for Status based on the dehumidifier state code in sensor.arete_two_status_code entity.

{% set status_code = states('sensor.arete_two_status_code') -%}

{% if status_code | int -%}

{% for x in range(0, 8) -%}
{% set result = 2 ** x -%}
{% set bit = x+1 -%}
{% if status_code | int | bitwise_and(result) -%} 
{% if    bit == 1 %}tankfull
{%- elif bit == 2 %}defrost
{%- elif bit == 3 %}E1
{%- elif bit == 4 %}E2
{%- elif bit == 5 %}L2
{%- elif bit == 6 %}L3: (too warm >40degC)
{%- elif bit == 7 %}L4: (too cold <5degC)
{%- elif bit == 8 %}wet
{% else %}
{% endif %} ({{ bit }})
{% endif -%}
{% endfor -%}

{% else %}Ok
{% endif %}
3 Likes