feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

jsn_sr04t component: AJ_SR04M compatibility mode

Open soeffi opened this issue 8 months ago • 4 comments

Describe the problem you have/What new integration you would like The AJ_SR04M ultarsonic module is very similar to the JSN SR04T and has similar operation modes.

There is only one differences in the protocol, which is the checksum calculation that does not include the first byte.

Instead of adding a new component, would it be possible to add a configuration variable (e.g. ajsq04m_mode, which defaults to false), which, if set to true, changes the checksum calculation from

uint8_t checksum = this->buffer_[0] + this->buffer_[1] + this->buffer_[2]; to uint8_t checksum = this->buffer_[1] + this->buffer_[2]; ?

Please describe your use case for this integration and alternatives you've tried:

see above

Additional context

see above

soeffi avatar Jun 25 '24 21:06 soeffi