StephanJoubert / home_assistant_solarman

Home Assistant component for Solarman collectors used with a variety of inverters.
Apache License 2.0
512 stars 191 forks source link

Add mask to rule 1 and rule 3 #340

Closed NemesisXB closed 12 months ago

NemesisXB commented 1 year ago

I have a DEYE 8kW inverter and for some of the registers where a 0 or 1 is expected, mine does not return a 0 or a 1, resulting in a LOOKUP string as the state of the enity. I saw however that bit 0 in those registers is the bit of interest. This PR adds a mask to the unsigned rules (1 & 3) so you can mask the required bit or bits. A possible further improvement can be adding a shift, so you can mask a bit or bits in the middle of the register value and shift it down (this has not been added in this PR)

Quintinvw commented 1 year ago

Works like a charm. Thanks. Also have a 8 kW Deye.