huawei_solar: [Bug]: removing and re-adding Integration does not allow switching to evelvated permissions

Describe the issue

Hi,

I ran into a similar issue as discussed in https://github.com/wlcrs/huawei_solar/discussions/190, where originally I had added my inverter(s) without elevated permissions, but would now like to enable them.

Following the suggestions in https://github.com/wlcrs/huawei_solar/discussions/190#discussioncomment-4241862 I tried to remove and reinstall the ingetration, but - while I could re-add the inverters no problem, with the history retained - I was not prompted for the installer password, and I do not seem to have elevated permissions.

Did I do something wrong?

Bescribe your Huawei Solar Setup

Inverter Type: SUN2000-5KTL-L1 (master), SUN2000-4KTL-L1 (slave) Inverter Firmware version: SDongle present: yes Power meter present: single phase Battery: None Battery Firmware version: n/a

How do you connect to the inverter?

Via the SDongle, wireless connection

Upload your Diagnostics File

Diagnostics File (before reinstall):

config_entry-huawei_solar-6bc38b13c42dd33e898c51bf2e025c08.json.txt

Diagnostics File (after reinstall): config_entry-huawei_solar-28a773df6e4f2ca6279ac53f82103d62.json.txt

Upload your relevant debug logs

2023-01-20 22:39:03.338 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration wundergroundpws which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-20 22:39:03.338 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-20 22:39:03.339 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration battery_sim which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-20 22:39:03.339 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration huawei_solar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-20 22:39:07.871 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that accesses the `is_metric` property of the unit system. This is deprecated and will stop working in Home Assistant 2023.1. Please adjust to use instance check instead.. Please report issue to the custom integration author for wundergroundpws using this method at custom_components/wundergroundpws/sensor.py, line 353: if hass.config.units.is_metric:
2023-01-20 22:39:19.134 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.fritz_dect_200_6.attributes.current_power_w }}'
2023-01-20 22:39:19.136 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.fritz_dect_200_6.attributes.current_power_w }}'
2023-01-20 22:39:19.137 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.fritz_dect_200_6.attributes.total_consumption }}'
2023-01-20 22:39:19.138 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.fritz_dect_200_6.attributes.total_consumption }}'
2023-01-20 22:39:19.138 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.termo.attributes.current_power_w }}'
2023-01-20 22:39:19.139 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.termo.attributes.current_power_w }}'
2023-01-20 22:39:19.140 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.termo.attributes.total_consumption }}'
2023-01-20 22:39:19.141 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.termo.attributes.total_consumption }}'
2023-01-20 22:39:19.142 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.fritz200.attributes.current_power_w }}'
2023-01-20 22:39:19.142 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.fritz200.attributes.current_power_w }}'
2023-01-20 22:39:19.143 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.fritz200.attributes.total_consumption }}'
2023-01-20 22:39:19.144 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.fritz200.attributes.total_consumption }}'
2023-01-20 22:39:19.144 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.recirculation_pump.attributes.current_power_w }}'
2023-01-20 22:39:19.145 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.recirculation_pump.attributes.current_power_w }}'
2023-01-20 22:39:19.145 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.recirculation_pump.attributes.total_consumption }}'
2023-01-20 22:39:19.146 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.recirculation_pump.attributes.total_consumption }}'
2023-01-20 22:39:19.147 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.fritz_dect_210_7.attributes.current_power_w }}'
2023-01-20 22:39:19.147 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'current_power_w' when rendering '{{ states.switch.fritz_dect_210_7.attributes.current_power_w }}'
2023-01-20 22:39:19.148 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.fritz_dect_210_7.attributes.total_consumption }}'
2023-01-20 22:39:19.148 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'total_consumption' when rendering '{{ states.switch.fritz_dect_210_7.attributes.total_consumption }}'
2023-01-20 22:39:19.150 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float)|round(3) }}")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1710, in forgiving_float_filter
return float(value)
ValueError: could not convert string to float: 'unknown'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 423, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1950, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1713, in forgiving_float_filter
raise_no_default("float", value)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1411, in raise_no_default
raise ValueError(
ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float)|round(3) }}' but no default was specified
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 540, in async_render_to_info
render_info._result = self.async_render(variables, strict=strict, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 425, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float)|round(3) }}' but no default was specified
2023-01-20 22:39:19.151 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float)|round(3) }}' but no default was specified') while processing template 'Template("{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float)|round(3) }}")' for attribute '_attr_native_value' in entity 'sensor.inverter_active_power_total'
2023-01-20 22:39:19.152 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ (states('sensor.power_meter_active_power_1')|float * float(-1) ) }}")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1710, in forgiving_float_filter
return float(value)
ValueError: could not convert string to float: 'unknown'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 423, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1950, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1713, in forgiving_float_filter
raise_no_default("float", value)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1411, in raise_no_default
raise ValueError(
ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.power_meter_active_power_1')|float * float(-1) ) }}' but no default was specified
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 540, in async_render_to_info
render_info._result = self.async_render(variables, strict=strict, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 425, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.power_meter_active_power_1')|float * float(-1) ) }}' but no default was specified
2023-01-20 22:39:19.158 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.power_meter_active_power_1')|float * float(-1) ) }}' but no default was specified') while processing template 'Template("{{ (states('sensor.power_meter_active_power_1')|float * float(-1) ) }}")' for attribute '_attr_native_value' in entity 'sensor.power_meter_active_power_inverse'
2023-01-20 22:39:19.159 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float - states('sensor.power_meter_active_power_1')|float)|round(3) }}")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1710, in forgiving_float_filter
return float(value)
ValueError: could not convert string to float: 'unknown'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 423, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1950, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1713, in forgiving_float_filter
raise_no_default("float", value)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1411, in raise_no_default
raise ValueError(
ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float - states('sensor.power_meter_active_power_1')|float)|round(3) }}' but no default was specified
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 540, in async_render_to_info
render_info._result = self.async_render(variables, strict=strict, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 425, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float - states('sensor.power_meter_active_power_1')|float)|round(3) }}' but no default was specified
2023-01-20 22:39:19.160 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float - states('sensor.power_meter_active_power_1')|float)|round(3) }}' but no default was specified') while processing template 'Template("{{ (states('sensor.inverter_active_power_1')|float + states('sensor.inverter_active_power_2')|float - states('sensor.power_meter_active_power_1')|float)|round(3) }}")' for attribute '_attr_native_value' in entity 'sensor.power_meter_active_load'
2023-01-20 22:39:19.161 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ (states('sensor.inverter_daily_yield_1')|float + states('sensor.inverter_daily_yield_2')|float )|round(3) }}")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1710, in forgiving_float_filter
return float(value)
ValueError: could not convert string to float: 'unknown'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 423, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1950, in _render_with_context
return template.render(**kwargs)
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "<template>", line 1, in top-level template code
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1713, in forgiving_float_filter
raise_no_default("float", value)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1411, in raise_no_default
raise ValueError(
ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.inverter_daily_yield_1')|float + states('sensor.inverter_daily_yield_2')|float )|round(3) }}' but no default was specified
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 540, in async_render_to_info
render_info._result = self.async_render(variables, strict=strict, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 425, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.inverter_daily_yield_1')|float + states('sensor.inverter_daily_yield_2')|float )|round(3) }}' but no default was specified
2023-01-20 22:39:19.163 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: float got invalid input 'unknown' when rendering template '{{ (states('sensor.inverter_daily_yield_1')|float + states('sensor.inverter_daily_yield_2')|float )|round(3) }}' but no default was specified') while processing template 'Template("{{ (states('sensor.inverter_daily_yield_1')|float + states('sensor.inverter_daily_yield_2')|float )|round(3) }}")' for attribute '_attr_native_value' in entity 'sensor.inverter_daily_yield_total'
2023-01-20 22:41:12.253 WARNING (MainThread) [homeassistant.components.automation] Error evaluating condition in 'PV Instalation - Inverter(s) disconnected':
In 'condition':
In 'or' (item 2 of 6):
In 'state':
In 'state' condition: unknown entity sensor.inverter_device_status_2
In 'or' (item 4 of 6):
In 'state':
In 'state' condition: unknown entity sensor.inverter_device_status_2
In 'or' (item 6 of 6):
In 'state':
In 'state' condition: unknown entity sensor.inverter_device_status_2
2023-01-20 22:41:23.902 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.power_meter_power_factor_1 (<class 'custom_components.huawei_solar.sensor.HuaweiSolarSensorEntity'>) is using native unit of measurement 'None' which is not a valid unit for the device class ('power_factor') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.
2023-01-20 22:44:12.886 WARNING (MainThread) [zigpy_deconz.api] No response to 'Command.aps_data_indication' command with seq id '0x2c'

Please confirm the following:

  • The problem is still present in the latest release of this integration.
  • I did not find an existing issue describing this problem.
  • I did upload the diagnostics-file that I could retrieve from the ‘Devices & Services Page’
  • I increased the logging configuration, restarted HA, and have copied all relevant log lines from the ‘Full Logs’ into the textarea.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 22 (11 by maintainers)

Most upvoted comments

It works! Thank you very much for your effort. 😃

Can you try again with 2.2.5b2?

Please also include the diagnostics file if you are still having problems.