Andre-Schuiki / esphome_im350

GNU General Public License v3.0
13 stars 8 forks source link

Added support for ESP8266 and general optimizations (code attached) #6

Open messier433 opened 8 months ago

messier433 commented 8 months ago

Hi,

main issue with the current version of the code is that it does not compile for ESP8266 since it has no Serial2 interface. Better approach is to derive the class from the uart component. Also the update method should not block the CPU for several 100ms until the message is completely received.

All these shortcomings (and general cleanup) are adressed in the attached code and an example config for ESP8266 is add with inverted RX line (no additional transistor used on PCB)

siemens_im350.zip siemens_im350_yaml.zip

LengTho commented 1 month ago

Hello

Hi,

main issue with the current version of the code is that it does not compile for ESP8266 since it has no Serial2 interface. Better approach is to derive the class from the uart component. Also the update method should not block the CPU for several 100ms until the message is completely received.

All these shortcomings (and general cleanup) are adressed in the attached code and an example config for ESP8266 is add with inverted RX line (no additional transistor used on PCB)

siemens_im350.zip siemens_im350_yaml.zip

I've tried your code on a ESP8266 but i get an error:

File "/usr/lib/python3.11/importlib/resources/readers.py", line 110, in init raise ValueError('Invalid path') ValueError: Invalid path

The configuration is valid, but compiling the C++ fails. Do you know whats the problem?

daniel89fhem commented 1 month ago

Hi. I think you had the same Problem as I. Here is the solution: To get the project building you have to add an empty init.py file into component folder /custom_components/siemens_im350

LengTho commented 1 month ago

Hi. I think you had the same Problem as I. Here is the solution: To get the project building you have to add an empty init.py file into component folder /custom_components/siemens_im350

Thank you for your hint, but this doesn't work for me. I still get the same error :(