Update
I’ve reworked some things to move some of the complexity into the huawei-solar library (cfr. integration change and library change ) instead of in the integration. This will help to get the latter approved as an ‘official’ integration. While doing this, I’ve set the update interval to 30 seconds for everything.
This reworking will cause some entities to be renamed. So you will need to remove and re-add the integration to get rid of the old ‘unavailable’ entities. That’s why I’m keeping it into the develop-branch for now.
@ligeza @gfpinto In the meantime, you can change the update intervals yourself by editing the const.py
file.
Write Support
I’ve worked out how to do the login on the inverter in the same way the FusionSolar app does. This enables write-support for some configuration options, all related to having a battery (maximum charge power, maximum discharge power, charging from the grid, …).
Who is interested in that can test my code using the login-and-write
branch. Note that it requires the installer
account to have the default password 00000a
for now.
Example on how to use this branch:
I plan on using this to create a “peak shaving” automation, which only allows my battery to discharge when drawing more than 2.5kW from the grid (which is taxed via a “capacity tariff” in Belgium).
I’m currently testing the following automation:
- alias: 'Use battery for peak shaving'
description: ''
trigger:
- platform: template
value_template: '{{ [states("sensor.power_consumption")| float - 2.5, 0] | max
}}'
action:
- service: number.set_value
target:
entity_id: number.maximum_discharging_power
data:
value: >-
{{ [
[states("sensor.power_consumption")| float - 2.5, 0] | max,
state_attr("number.maximum_discharging_power","max")
] | min }}"
mode: single
Note: I haven’t been able to test this new functionality for long-term stability yet. Please report any unexpected behavior to me (here, or by creating an issue on GitHub)
Sidenote: this integration cannot be combined with Emilv2’s integration. They would steal the connection to the inverter from each other the whole time, resulting in neither working at all.