MorneSaunders360 / Solar-Sunsynk

Monitor your energy generation, storage, and usage data using an unofficial API from Sunsynk
MIT License
9 stars 2 forks source link

Sensors using wrong units (kWh insted of W) #4

Closed Nurgus closed 1 year ago

Nurgus commented 1 year ago

I've just grabbed the latest version and can see it's looking great!

I think units kWh are being used instead of W and also device class "power" should be "energy" on some sensors.

Sensors such as sensor.sunsynk_X_gridormeterpower are showing kWh where they should be W. They have the correct device_class: power

Sensors such as sensor.sunsynk_X_emonth has the correct units but device_class: power should be device_class: energy as they are power over time (energy) - aside from a slightly different icon I don't really know what difference it makes but I'm mentioning it anyway!

Thanks for the great work.

MorneSaunders360 commented 1 year ago

I'm glad you found the modifications helpful and thank you for your accurate observation!

The changes you suggested have been incorporated. The power-related sensors ("pvPower", "battPower", "gridOrMeterPower", "loadOrEpsPower", "genPower", "minPower", "pac") now report in "W" (Watts) and are correctly classified under "power". Meanwhile, energy-related sensors ("etoday", "etotal", "emonth", "eyear", "totalPower") report in "kWh" (kilowatt-hours) and are classified under "energy".

Your feedback is invaluable and helps ensure the sensor's data representation is accurate and intuitive. Don't hesitate to reach out if you have more suggestions or if there's anything else I can assist you with. Happy energy monitoring!