Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solar input showing 800w when its 80w on delta pro #19

Closed
icemandk opened this issue Feb 12, 2023 · 5 comments
Closed

Solar input showing 800w when its 80w on delta pro #19

icemandk opened this issue Feb 12, 2023 · 5 comments
Assignees

Comments

@icemandk
Copy link

Running integration version 0.7.5 on Delta Pro

Solar input sensor >> sensor.deltapro_solar_in_power

excample sensor is showing : 800w when its actually generating 80w

@tolwi
Copy link
Owner

tolwi commented Feb 19, 2023

The solar input sensor is currently bound to mppt.inWatts - looks like it is wrong.
Try to find the correct data key from diag dump, please.

@ekashuba
Copy link

I just received my Delta Pro's today and I've run into the same issue as icemandk. I've looked through the diagnostic dump and I don't see any key other than "mppt.inWatts" which might contain the correct value.

Is there an easy way to tweak the code so that the value returned from Ecoflow can be divided by 10?

(Sorry if there's a simple answer to that -- I'm a total newb when it comes to Python).

@ekashuba
Copy link

OK -- I think I've come up with a quick workaround to this issue. As I mentioned above, though, I have no idea what I'm doing so use this at your own risk!

I ended up making changes to 2 of the files in this integration. The first change defines a new class to handle the solar input and divides the value of the solar input that it's getting from Ecoflow by 10. The second change modifies the sensor for the solar input to use that new class.

In the /config/custom_components/ecoflow_cloud/sensor.py file I added a new class called "InWattsSolarSensorEntity" . I don't know python so I just used the existing code as a model and then I tweaked it a bit by adding this code. I'm not going to pretend to know what it's doing but here it is:

class InWattsSolarSensorEntity(WattsSensorEntity):
    _attr_icon = "mdi:solar-power-variant-outline"

    def _update_value(self, val: Any) -> bool:
        if self._attr_native_value != val/10:
            self._attr_native_value = val/10
            return True
        else:
            return False

In the /config/custom_components/ecoflow_cloud/devices/delta_pro.py file I changed the way that the sensor using the "mppt.inWatts" value is configured so that it now uses the new class that was defined above:

I changed this line in the delta_pro.py file:

    InWattsrSensorEntity(client, "mppt.inWatts", const.SOLAR_IN_POWER),

to this:

    InWattsSolarSensorEntity(client, "mppt.inWatts", const.SOLAR_IN_POWER),

Since I'm now using this new class in the delta_pro.py file I also needed to make sure that it was included in the header at the top of the delta_pro.py file:

    from ..sensor import LevelSensorEntity, WattsSensorEntity, RemainSensorEntity, TempSensorEntity, \
        CyclesSensorEntity, InWattsSensorEntity, InWattsSolarSensorEntity, OutWattsSensorEntity, VoltSensorEntity		

Once I made those changes I restarted Home Assistant and I'm now getting the correct values for my solar inputs. I'm sure that there are better ways to handle this but this seems to be working for me.

@herbyak
Copy link

herbyak commented Jun 2, 2023

HI, I have the same issue on my DP Pro. Is somebody working on a solution for that? There should be an easy way to adjust that for us user!

@mattwells
Copy link
Contributor

mattwells commented Jun 8, 2023

I descovered this "issue" while playing around putting the MQTT messages directly into InfluxDB. Apparently it is common for UPS to use deciwatt (1/10 a watt) and Ecoflow has also adopted it for this field, presumably because it gives more precision while not having to use a float or decimal.

You can see in hassio-ecoflow project it has been compensated for with the div=10 here: https://github.com/vwt12eh8/hassio-ecoflow/blob/c78701faf3cd0318ee7674fbe8eca2a86566979b/custom_components/ecoflow/ecoflow/receive.py#L382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants