sunsynk icon indicating copy to clipboard operation
sunsynk copied to clipboard

Load port power

Open cc120689 opened this issue 1 year ago • 6 comments

Hello again John, this is not a bug, it is more of a question to implement a new sensor or calculate it. I would like to know what would be the sensor that gives the exact measurement of the power in the physical load port of the inverter, normal sensors do not change if the inverter is connected as a grid inverter or as an isolated one, however the deye cloud application identifies the data from UPS power. Can you think of how to calculate it? thank you

cc120689 avatar Nov 23 '23 22:11 cc120689

Today there are some calculated sensors - or MathSensors - see https://github.com/kellerza/sunsynk/blob/655ce5c0a2a5fe8edd6139398ee02a4ccb6156b0/src/sunsynk/definitions.py#L100 for some examples

Of you want to build a new one, try to view all the interested registers at the same time to see how they are related. This works really nice in the template developer tools once you’ve added the individual sensors (or even dev tools - states, if you can filter on a similar name)

kellerza avatar Dec 27 '23 05:12 kellerza

ok, thank you very much, I'm going to try and see if I can figure it out, I'll add them in mysensors.py, right? Greetings and Merry Christmas!

cc120689 avatar Dec 27 '23 08:12 cc120689

Yes, add them in mysensors, as an example:

SENSORS += [
Sensor(175, "register 175", WATT),
Sensor(169, "register 169", WATT),
Sensor(166, "register 166", WATT),
]

Then also make sure your schedule for WATT reads often,- i.e. every second or 2 - https://kellerza.github.io/sunsynk/reference/schedules

Then you can play with templates to do a calc until you find the combination that works. Once you find it create a MathSensor or create you own custom sensor to do the calc between the registers if this is more than + & -

kellerza avatar Dec 29 '23 07:12 kellerza

Ok thanks!! Excuse me, where is the information from all the possible mathematics sensors? I don't see it in the guide

cc120689 avatar Dec 29 '23 07:12 cc120689

You will have to look at the code. Sensors.py likely

the mathsensor simply adds registers together. Some + some -, depending on the sign of the factor

kellerza avatar Jan 02 '24 19:01 kellerza

Ah ok only + or - are possible

cc120689 avatar Jan 03 '24 12:01 cc120689