Beaky2000 / esphome-p1mini

ESPHome external component for reading P1 data from (Swedish) electricity meters
MIT License
128 stars 26 forks source link

Increase telegram size #17

Closed tomasvilda closed 1 year ago

tomasvilda commented 1 year ago

In Lithuania, energy provider uses energy meter Sagemcom T211 it sends more data than maximum size of 2048 bytes currently specified. Double the maximum telegram size to 4096.

Beaky2000 commented 1 year ago

Interesting! Is the longer messages because there are more sensors available? Would it make sense to add these to the yaml file?

I am thinking that it might be better to allocate the buffer dynamically and ideally in some smart way where the required size is determined automatically. Not sure how that would work though. I will think about it.

tomasvilda commented 1 year ago

Yes, there is more sensors, all data that is provided to us is here:

https://www.eso.lt/download/523006/p1%20s%C4%85sajos%20duomen%C5%B3%20modelis.pdf

Beaky2000 commented 1 year ago

I have given this some thought and I would like to increase the buffer size dynamically instead of setting a fixed size which will be unnecessarily large for most. But before implementing this I will add some timeouts so the buffer wont grow uncontrollably in case of a communication error.

I hope to have some time for this during the christmas holidays.