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
Platform cse7766: use pulses for total energy calculation #1122
Comments
This would be nice to have with all the energy stuff in the new home assistant! |
+1 for this change |
@ianchi This is absolutely great. Nearly missed the feature since I did not see the mail stating it's closed. Thank you very much! |
@ianchi, one more question. How does it work with calibration? I have found https://frenck.dev/calibrating-an-esphome-flashed-power-plug/ which uses a sensor filter to calibrate. But I assume that it's not honored in the code that multiples the pulses with the current. I also have seen that a calibrated value is read from sensor data: Do you know how that calibration actually works? |
cse7766 has calibration data written in by the manufacturer. As it is a separate chip this data is retained after flashing ESPhome, so it should just work. As this component has no parameter to manually adjust values, if outputs are not correct in your case, you can apply a filter to individual sensors to recalibrate them. But as you said, all sensors should be calibrated independently (voltage/current/power/energy). |
Describe the problem you have/What new integration you would like
The cse7766 platform currently reads voltage, current and power from the sensor. To calculate the energy consumption over a time period, one must integrate over the power which requires a high time resolution for precise values. This is not possible with this implementation.
The cse7766 itself provides a pulse counter which gives a wat-per-time information that is suitable to calculate the energy consumtion over time (e.g. how much kilowatt-hours have been consumed in a given time). This should be supported by the platform
Please describe your use case for this integration and alternatives you've tried:
Documentation suggest to use total_daily_energy platform. Drawback is that it works only for very constant loads. For changing loads it's very in-accurate.
Additional context
The specification can be found at http://dl.itead.cc/S31/CSE7766.pdf (page 21 and following)
An implementation can be found in https://github.com/arendst/Tasmota/blob/ac054ea666a2e2ea764346db3b69bb1723df00f0/tasmota/xnrg_02_cse7766.ino
The text was updated successfully, but these errors were encountered: