Support for AVM Fritz! Smart Home Components

Hi @CM000n,

Thank you for the examples, they helped me very much.
I started to use the Component from @hthiery right now, it is fantastic!

Concerning the FritzDECT Switches I had a little problem:

When trying to read the current Power Consumption of a FritzDECT 100 (or 200) as in your example above with:

value_template: ‘{{ states.switch.stecker_trockner.attributes[“current_power_w”] | float | round(1) }}’

I got this:

Error rendering template: UndefinedError: ‘mappingproxy object’ has no attribute ‘current_power_w’

A little research showed the following behaviour:

It doesn’t matter if the switch is set to on or off, if there is no load (no current flow) at the FritzDECT Plug, the attribute is missing.

So, depending on the current flow (zero vs nonzero), the attribute “current_power_w” disappears/appears dynamically in the state list.

My workaround to avoid the error above is this template in the sensor definition:

    value_template: >
      {% if  states.switch.stecker_trockner.attributes["current_power_w"] %}
        {{ states.switch.stecker_trockner.attributes["current_power_w"] | float | round(1) }}
      {% else %}
        0.0
      {% endif %}

Seems to work, but the question is,
Why has (only?) this attribute such a dynamic behaviour ??

Anyway: Thanks to @hthiery for his great work to integrate FritzDect into Home Assistant!

BTW:
I’m Using HassIO 0.84.2
FritzBox 7490 Firmware Release: 7.01

.

2 Likes

Hi All.

great to hear that someone else is using the components …

By the way … the sensor template can be eased by using the state_attr('switch.stecker_trockner', 'current_power_w').

1 Like

Hi @hthiery

thank you, That’s a lot easier!
I’m still trying to find may way through HA und the Jinja jungle :smile:

Is it possible to set the window mode for a thermostat by an automation? Or can this only be triggered by the thermostat itself?

Thanks for that Tip

As far as I know this is only autonomously detected by the thermostat.