Closed alkissack closed 2 years ago
please see HomeAssitant #68821 that advises of action needed in integrations with power attributes
https://github.com/home-assistant/core/pull/68821
"Switch entities for the integrations aten_pe, dlink, edimax, elv, emulated_kasa, fibaro, hive, homematicip_cloud, mfi, mqtt, mystrom, netio, vera, wemo will no longer contain energy attributes as informed on July 22, 2021. These entities should be added as sensor entities by the integration developers."
Yea, is this repo still active? I've been using it for a while and it's the best implementation of the Hive component out there.
I make a lot of use of the power sensors on Hive switches - mainly in triggering automations. @KJonline I can help with implementing this if you're still interested in this component.
Yea, is this repo still active? I've been using it for a while and it's the best implementation of the Hive component out there.
I make a lot of use of the power sensors on Hive switches - mainly in triggering automations. @KJonline I can help with implementing this if you're still interested in this component.
I moved my plugs to Zigbee(MQTT) and read power off them there (pending this being fixed)
@von-Chaps thanks for the offer and support I have an outstanding pull request to have there own sensor showing the power usage. Just need to make a couple of changes and get it approved the ha team
@KJonline That's fantastic news.
Just for my understanding, I assume you mean the "official" Hive component in the HA repo and not this custom one here? Should we be using that one now rather than this one?
Fixed in 202.7.1
Describe the bug Since loading core-2022.4 the template sensor that reported current power, an attribute, of Hive plug has stopped being reported and doesnt now appear to be listed as an attribute in developer tools.
To Reproduce Steps to reproduce the behaviour: Examine plug attributes and note the power is no longer visible. Template sensor:
Expected behaviour Plug power is measured and was available as an attribute
Screenshots
Desktop (please complete the following information): core-2022.4.1 supervisor-2022.03.5 Home Assistant OS 7.6
Additional context logs: `2022-04-07 09:26:56 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ states["switch.hiveplug1"].attributes.current_power_w | round(2) }}") Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 407, in async_render render_result = _render_with_context(self.template, compiled, kwargs) File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1820, in _render_with_context return template.render(kwargs) File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 1291, in render self.environment.handle_exception() File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 926, in handle_exception raise rewrite_traceback_stack(source=source) File "", line 1, in top-level template code File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1320, in forgiving_round value = round(float(value), precision) jinja2.exceptions.UndefinedError: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w'
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 523, in async_render_to_info render_info._result = self.async_render(variables, strict=strict, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 409, in async_render raise TemplateError(err) from err homeassistant.exceptions.TemplateError: UndefinedError: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' 2022-04-07 09:26:56 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('UndefinedError: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w'') while processing template 'Template("{{ states["switch.hiveplug1"].attributes.current_power_w | round(2) }}")' for attribute '_attr_native_value' in entity 'sensor.hive_plug1_power'`