When I add “state_class: total_increasing” to those sensors templates it breaks it…
Are you using newest HA? Are the templates in new format:
template:
- sensor:
No it’s the
Template:
Sensors:
Power_exported:
Value_template: {{ states(‘sun’) }}
…
But if I add-
Device_class: energy
State_class: total_increasing
It doesn’t work
could you post your config (part with this template sensors, maybe there is some text formatting problem) in preformated text
#Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
#Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
#Solar
sensor:
- platform: huawei_solar
host: ‘192.168.200.1’
optimizers: false
battery: false
slave: 0
name: “test_gridxchange”
unique_id: m_grid_exporterd_energy
unit_of_measurement: ‘kWh’
icon: mdi:transmission-tower
state: >
{% if state_attr(‘sensor.sun2000_5ktl_l1_hv2150011134’,‘grid_exported_energy’) | float(0) > 0 %}
{{ state_attr(‘sensor.sun2000_5ktl_l1_hv2150011134’,‘grid_exported_energy’) | float(0) }}
{% endif %}
device_class: energy
state_class: total_increasing
template:
- platform: template
sensors:
pv_01_voltage:
friendly_name: “pv_string_01_voltage”
unit_of_measurement: ‘V’
icon_template: mdi:flash-alert-outline
value_template: “{{ state_attr(‘sensor.sun2000_5ktl_l1_hv2150011134’, ‘pv_string_01_voltage’) }}”
pv_02_voltage:
friendly_name: "pv_string_02_voltage"
unit_of_measurement: 'V'
icon_template: mdi:flash-alert-outline
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'pv_string_02_voltage') }}"
pv_01_current:
friendly_name: "pv_string_01_current"
unit_of_measurement: 'A'
icon_template: mdi:current-dc
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'pv_string_01_current') }}"
pv_02_current:
friendly_name: "pv_string_02_current"
unit_of_measurement: 'A'
icon_template: mdi:current-dc
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'pv_string_02_current') }}"
phase_a_voltage:
friendly_name: "phase_A_voltage"
unit_of_measurement: 'V'
icon_template: mdi:flash-alert-outline
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_A_voltage') }}"
phase_b_voltage:
friendly_name: "phase_B_voltage"
unit_of_measurement: 'V'
icon_template: mdi:flash-alert-outline
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_B_voltage') }}"
phase_c_voltage:
friendly_name: "phase_C_voltage"
unit_of_measurement: 'V'
icon_template: mdi:flash-alert-outline
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_C_voltage') }}"
m_grid_a_voltage:
friendly_name: "grid_A_voltage"
unit_of_measurement: 'V'
icon_template: mdi:flash-alert-outline
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_A_voltage') }}"
m_grid_b_voltage:
friendly_name: "grid_B_voltage"
unit_of_measurement: 'V'
icon_template: mdi:flash-alert-outline
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_B_voltage') }}"
m_grid_c_voltage:
friendly_name: "grid_C_voltage"
unit_of_measurement: 'V'
icon_template: mdi:flash-alert-outline
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_C_voltage') }}"
phase_a_current:
friendly_name: "phase_A_current"
unit_of_measurement: 'A'
icon_template: mdi:current-ac
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_A_current') }}"
phase_b_current:
friendly_name: "phase_B_current"
unit_of_measurement: 'A'
icon_template: mdi:current-ac
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_B_current') }}"
phase_c_current:
friendly_name: "phase_C_current"
unit_of_measurement: 'A'
icon_template: mdi:current-ac
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_C_current') }}"
pv_input_power:
friendly_name: "input_power"
unit_of_measurement: 'W'
icon_template: mdi:solar-power
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'input_power') }}"
power_meter_active_power:
friendly_name: "power_meter_active_power"
unit_of_measurement: 'W'
icon_template: mdi:transmission-tower
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'power_meter_active_power') }}"
power_meter_load:
friendly_name: "consumption"
unit_of_measurement: 'W'
icon_template: mdi:flash-alert-outline
value_template: "{{ states('sensor.sun2000_5ktl_l1_hv2150011134') |float(0) - state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'power_meter_active_power') |float(0) }}"
device_class: energy
state_class: total_increasing
power_generated:
friendly_name: "generation"
unit_of_measurement: 'W'
icon_template: mdi:solar-power
value_template: "{{ states('sensor.sun2000_5ktl_l1_hv2150011134') }}"
device_class: energy
state_class: total_increasing
power_shipped:
friendly_name: "shipped"
unit_of_measurement: 'W'
icon_template: mdi:transmission-tower
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'power_meter_active_power') }}"
device_class: energy
state_class: total_increasing
active_grid_a_power:
friendly_name: "active_grid_A_power"
unit_of_measurement: 'W'
icon_template: mdi:transmission-tower
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'active_grid_A_power') }}"
active_grid_b_power:
friendly_name: "active_grid_B_power"
unit_of_measurement: 'W'
icon_template: mdi:transmission-tower
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'active_grid_B_power') }}"
active_grid_c_power:
friendly_name: "active_grid_C_power"
unit_of_measurement: 'W'
icon_template: mdi:transmission-tower
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'active_grid_C_power') }}"
m_grid_exported_energy:
friendly_name: "grid_exported_energy"
unit_of_measurement: 'kWh'
icon_template: mdi:transmission-tower
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_exported_energy') }}"
m_grid_accumulated_energy:
friendly_name: "grid_accumulated_energy"
unit_of_measurement: 'kWh'
icon_template: mdi:transmission-tower
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_accumulated_energy') }}"
daily_yield:
friendly_name: "daily_yield"
unit_of_measurement: 'kWh'
icon_template: mdi:transmission-tower
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'daily_yield') }}"
total_yield:
friendly_name: "total_yield"
unit_of_measurement: 'kWh'
icon_template: mdi:transmission-tower
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'total_yield') }}"
pv_temperatura:
friendly_name: "internal_temperature"
unit_of_measurement: '°C'
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'internal_temperature') }}"
inverter_device_status:
friendly_name: "inverter_device_status"
#unit_of_measurement: '°C'
value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'device_status') }}"
pv_efficiency:
friendly_name: "pv efficiency"
unit_of_measurement: '%'
value_template: >
{% if state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'efficiency')|float < 100 %}
{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'efficiency') }}
{% else %}
0
{% endif %}
energy_used:
friendly_name: "energy_used"
unit_of_measurement: 'kWh'
value_template: >
{{ '%0.2f' | format(states('sensor.total_yield') | float -
states('sensor.m_grid_exporterd_energy') | float +
states('sensor.m_grid_accumulated_energy') | float) }}
You are using " Legacy sensor configuration format" so it will not work. In this configuration you can add this in customization entity menu or
sensor.sun2000_5ktl_l1_hv2150011134:
device_class: energy
state_class: measurement
sensor.power_meter_load:
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
sensor.power_generated:
state_class: measurement
device_class: power
sensor.power_shipped:
state_class: measurement
device_class: power
this doesnt get it to show up in configuration>energy
Hi!
I’ve successfully upgraded my SUN2000-6KTL-M0 to:
V100R001C00SPC139 (inverter)
V100R001C00SPC124 (dongle)
I had to explicitly enable the ModBus-TCP port using Android APP (it is the inverter setting as I enabled it even with previous dongle software running at a time).
The downside however is the query times: it is about another 5 seconds more for the same complete parameter set when running the older firmware
And I was hoping that it will be better. It is not comparable to internal wifi which is very fast…
Isn’t it a pity that using a LAN cable, the times are several times more then a wifi?
Oh huawei, why?!
Hello everyone,
As you can see from the images HA Energy tab creates me some trouble in reading zeros, when an entity reports “0” HA applies every time an increment equal to the reading after the zero, therefore I get wrong Energy values.
I tried both with
float(0)
and float
but no improvement, does anybody know how to address the issue?
grid_exporterd_energy:
friendly_name: "Grid Exported Energy"
unit_of_measurement: 'kWh'
value_template: "{{ state_attr('sensor.sun2000_8ktl_m1', 'grid_exported_energy') | float }}"
device_class: energy
grid_accumulated_energy:
friendly_name: "Grid Accumulated Energy"
unit_of_measurement: 'kWh'
value_template: "{{ state_attr('sensor.sun2000_8ktl_m1', 'grid_accumulated_energy') | float }}"
device_class: energy
Check my configuration. I added checking if it’s bigger then 0. I also had this problem after restarting HA. Now it’s working correctly for me.
{% if state_attr('sensor.sun2000_8ktl_m0','grid_exported_energy') | float(0) > 0 %}
{{ state_attr('sensor.sun2000_8ktl_m0','grid_exported_energy') | float(0) }}
{% endif %}
@ligeza, thanks pal, that made the “magic”.
Question, did you manage to use power card also? I’d like to find a way to replicate in HA the Power Flow as shown in FusionSolar app.
Thanks again!
So, after some cross-check I noticed that, in a situation like mine with double inverter and 3 batteries (2 batteries read on an inverter, 1 on the other), the integration isn’t able to read properly the whole system.
Straight question, would it be possible for the integration to read data both from slave: 1
and slave: 2
?
Hey, I have also followed the instructions to setup this integration.
Added this in configuration.yaml:
- platform: fusion_solar_kiosk
kiosks:- id: “myID”
name: “solar”
- id: “myID”
But I don’t see the sensor in my HASS entities. I only see the Integration is installed in HACS, but nothing else shows up in HASS related to FusionSolar (no Integration, Devices, Entities).
Anything I might be overlooking?
Your formatting is probably not correct, the “kiosks:” element needs to be indented further, like this:
sensor:
- platform: fusion_solar_kiosk
kiosks:- id: xxx
name: xxx
- id: xxx
In my case I don’t get an error in the configuration, but the entity does not show up in HASS…
Please let me know if you get it to work because seems I didn’t.
Just found it, cost me a whole day
I had multiple “sensor:” elements in configuration.yaml.
This has an effect that only of these will be recognized, the others are simply ignored and will show up nowhere in HASS .
I’m completely new to the setup. I would like to have both FusionSolar and HomeAssistant connected to the inverter via LAN. Is that possible? Which versions of the firmware make that possible?
I currently have V100R001C00SPC119 for my dongles and V200R001C00SPC109 for the inverters. I don’t know about the battery, it’s currently offline for some reason.
(Also, did anyone compile a guide for this somewhere? This topic has a lot of history of which some parts are probably deprecated now, others not, different firmware versions have been used, … Difficult to understand what the current go-to situation should be, but that may just be me of course!)
it’s possible, I have it that way.
Just setup normally for the fusion solar, then setup the hacs plugin. Use slave option when configuring for hacs.
I have these firmwares:
V100R001C00SPC123 for dongle and V100R001C00SPC139 for inverter.
Thanks for getting me those versions! Now I can tell my installer to upgrade to those specific ones.
Did you have to enable the port through the android app for this setup, or is the port open by default with these versions?