Emilv2 / huawei_solar

Home Assistant custom component for Huawei inverters
Apache License 2.0
174 stars 41 forks source link

I have run out of integration #36

Open docebit opened 2 years ago

docebit commented 2 years ago

hello, for a few days this integration has not worked for me. The error message I get is:

Logger: homeassistant.helpers.template Source: helpers/template.py:1624 First occurred: 16 de octubre de 2021 00:35:54 (2247 occurrences) Last logged: 23:15:53

Template variable error: 'None' has no attribute 'replace' when rendering '{{ state_attr('sensor.sun2000_5ktl_l1', 'system_time').replace(hour=0,minute=0,second=0,microsecond=0) }}'

Logger: homeassistant.components.template.template_entity Source: components/template/template_entity.py:73 Integration: Template (documentation, issues) First occurred: 16 de octubre de 2021 00:35:54 (5 occurrences) Last logged: 16 de octubre de 2021 00:35:54

TemplateError('UndefinedError: 'None' has no attribute 'state'') while processing template 'Template("{{ ((states.sensor.sun2000_5ktl_l1.state | int) - (states.sensor.power_meter_active_power.state | int)) }}")' for attribute '_attr_native_value' in entity 'sensor.consumo_vivienda' TemplateError('TypeError: '<' not supported between instances of 'NoneType' and 'int'') while processing template 'Template("{% if (state_attr('sensor.sun2000_5ktl_l1', 'power_meter_active_power') < 0 ) %} {{ (states('sensor.sun2000_5ktl_l1')|float) }} {% else %} {{ ( (states('sensor.sun2000_5ktl_l1')|float) - (state_attr('sensor.sun2000_5ktl_l1', 'power_meter_active_power')|float) ) }} {% endif %}")' for attribute '_attr_native_value' in entity 'sensor.autoconsumo_vivienda' TemplateError('UndefinedError: 'None' has no attribute 'replace'') while processing template 'Template("{{ state_attr('sensor.sun2000_5ktl_l1', 'system_time').replace(hour=0,minute=0,second=0,microsecond=0) }}")' for attribute 'last_reset' in entity 'sensor.solar_production' TemplateError('UndefinedError: 'None' has no attribute 'replace'') while processing template 'Template("{{ state_attr('sensor.sun2000_5ktl_l1', 'system_time').replace(hour=0,minute=0,second=0,microsecond=0) }}")' for attribute 'last_reset' in entity 'sensor.grid_consumption' TemplateError('UndefinedError: 'None' has no attribute 'replace'') while processing template 'Template("{{ state_attr('sensor.sun2000_5ktl_l1', 'system_time').replace(hour=0,minute=0,second=0,microsecond=0) }}")' for attribute 'last_reset' in entity 'sensor.grid_exported'

I don't know how to fix it. Can you give me a hand?

JacoboSanchez commented 2 years ago

In my opinion this is a collateral error that templates are not obtaining values from the integration. Don't you have previous errors loading the huawei_solar integration? did you try to restart the inverter and checked that its IP addres has not changed from the one specified in the integration?

docebit commented 2 years ago

In my opinion this is a collateral error that templates are not obtaining values from the integration. Don't you have previous errors loading the huawei_solar integration? did you try to restart the inverter and checked that its IP addres has not changed from the one specified in the integration?

Hello, I have rebooted the inverter and the HA. They both keep the same IP as they had before the error.

JacoboSanchez commented 2 years ago

I am sorry, with that information from logs I don't know what can be the reason. In this other topic you posted a log with connection errors after the template ones... I don't know which can cause those if connection parameters are ok.

Did you tried to connect directly with fusion app to the inverter (through the wifi, not internet) and works? Also are your home assistant in the same network than the inverter? Port 502 will not respond if you are connecting from a different subnetwork. Do you have an old firmware version? I think that older versions only allow modbus connection if you are directly connected to the builtin wifi network

I do not have any more ideas on what can be preventing you to connect the inverter

docebit commented 2 years ago

Hello there

She had gone through all of that and had it perfectly set up. The Home Assistant hadn't updated it since the system crashed and prior to that it was working perfectly for me. When it failed, I updated Home Assistant with some pending Core and System updates and it didn't recover either. Today there was another Home Assistant update, I have applied it and by magic everything has worked perfectly again, without touching any parameter or anything. The Home Assistant gives me a lot of headaches.

Thank you anyway. If you need any information regarding the version that I currently have of Home Assitant to certify that everything works fine with the last one, you just have to ask me.

Greetings.