psvanstrom / esphome-p1reader

ESPHome custom component for reading P1 data from electricity meters.
MIT License
251 stars 106 forks source link

Bugfix for sign conversion #91

Open alfs opened 1 month ago

alfs commented 1 month ago

HDLC 0x10 is a signed 2-byte integer, but was put in 32 bit signed variable so the sign was lost for negative values (when current is negative / power is exported to the grid)