My use case is that I trying to control a Panasonic AirCondition using Modbus binding. I am using USB on an Ubunto box to connect and I have configured a 99-openhab.rules with udev. So I have no problem with shifting USB names or permissions.
If I have my AirCondition always powered on everything is working fine in the binding in all situations.
However, the AirCondition seem to have a quite high standby power consumption including the 2 indoor units. Therefore, to save power I have implemented this when it is turned on from openHAB:
- Turn on power relay to AirCondition
- Wait 10 seconds
- Rename AirCond.thingsIncative file to AirCond.things
- Wait 5 seconds
- Set AirCondition state to what is requested from openHAB.
The rename is to get that thing active in Modbus and openHAB. When the AirCond is shut off, I do reverse of above.
The problem is that it is not stable, so sometimes I get that the USB port is already in use, and the log is spammed. A restart of openhab solves it, but that is not a good solution. It seems that the usb port is not always released and closed.
I have also tried dynamicly to start and stop the modbus binding using karaf console, but that is even less stable. The problem is the same, that sometimes it says that the usb port is already in use.
The best option for me would be if the binding had “Active true/false” as a property on the bridge or poller. But this does not exist.
Any suggestions would be very welcome. Also if it is possible to force a release of the usb port by a Linux OS command or similar.