Optimized ComfoAir binding - Lower CPU usage

Hello,

I researched a bit on the ComfoAir binding to reduce the CPU consumption and added the known RXTX serial optimization. I also add smaller changes to prevent unlimit thread growth (theoretically) and remove the flush() function.

  • Add CPU workaround for RXTX event listener thread
  • Remove flush() function, not required and sometimes the binding hangs there
  • Use ScheduledExecutorService instead of creating new Threads with Thread.sleep(…)

I already uploaded the changes to github https://github.com/csowada/openhab/tree/comfoair-optimize/bundles/binding/org.openhab.binding.comfoair

This modification runs since a week without any issues.

Download:
https://drive.google.com/open?id=0B5Vjy5Qe0CabSlJtUVV0SWJoMTA

Also create a pull request so your changes, if accepted, get included in the official release and carried forward.

Yes i will do that if I got feedback from other users. And I have to setup the new IDE enviroment first :slight_smile: , I still used the 1.8 IDE setup.

So, I attached the compiled version in the first topic.

https://drive.google.com/open?id=0B5Vjy5Qe0CabSlJtUVV0SWJoMTA

Hi @csowada

I’m struggling for ages with this binding - don’t get it running :frowning:

Are your changes already integrated into v1.8.2? If not can you pls send me a download link to your latest jar file?
Within the next days I can test a lot and give you feedback.

Thanks & Regards
John

Hello,

I’ve created a new version of this modified binding. The old version worked well with version 1.8.x, now I’ve ported the changes to the newest code base. So it works in openHAB 1.x and 2.x.

You can download the snapshot here:
https://drive.google.com/open?id=0B5Vjy5Qe0Cabel96WFA1c3cwMUk

And now I also create a PR on github :grinning:

1 Like

Hello,

I need tester for this modification. I hope I can motivate some people here to help.

Thanks

Hi csowada,

as soon as I have connected my ComfoAir to openhab (hopefully sometime next week), I can start testing your improved binding and provide feedback.

Cheers,
Matt

Hey csowada,

I’ve installed your improved binding yesterday on my openhab 1.x system. So far it’s running without any problems! Thank you very much. If I’ll come across something, I’ll let you know.

Regards,
Matt

1 Like

Hi,

After running for about 3 days, I just noticed that the binding logged errors in openhab.log:

Error writing to serial port ...

(many log entries per second).

Please note that the comfoair unit is not connected directly to the machine running openhab. It is connected to a raspberry and I am accessing it via a virtual serial port from openhab (I use ser2net on the rpi and socat on the machine running openhab). Anyway, I do not think that this actually caused the problem, since another service using the same setup and connected to the same raspberry continued to work.
I tried to do reload the comfoair binding with

touch ../addons/org.openhab.binding.comfoair-1.10.0-SNAPSHOT.jar

but then openhab crashed and before I could save the logs, openhab was restarted automatically by monit (which also deletes the logs, sorry)

Is there anything you want me to do if this will happen again?

Cheers,
Matt

Mh, not good. Maybe the removed flush command is missing on your setup and maybe this flush command is depended on the used serial driver (ser2net vs. ftdi usb serial converter) on operating system level.

I created a version with flush, could you please check both versions if possible.
https://drive.google.com/open?id=0B5Vjy5Qe0Cabei1DeTF4c3RiT0U

1 Like

Hey there, short update…
I have installed the version with flush, added more logging and disabled automatic restarts from monit. Again I have seen the same error messages, but this time I have seen that the socat instance running on the openhab machine crashed (so actually there was no longer a virtual serial port to talk to). So it is obvious why the binding generated the error messages.

I have no idea why socat crashed (I am using the same setup for the DSMR binding and this has been running without problems for ages).

Anyway, I have installed your first binding again (without flush) and I am trying to troubleshoot the virtual serial port issue further. The binding itself is running perfectly.

Thanks,
Matt

Do you still need testers or is your version already the one available with openhab2 download? I got error messages with the current openhab2 binding - does it make sense to test your binding on a comfoair 550?

The update was merged into the main repository. But it is easy to test, so feel free to check it.