I am just starting out with OpenHAB. I have installed OH 2.0 on Ubuntu Server 16.04.1 (LTS), and I am trying to get it to work with a Samsung Smart Air Conditioner.
First of all, that binding’s documentation could really, REALLY use some updating… (the only one I could find was here: https://github.com/openhab/openhab1-addons/wiki/Samsung-AC-binding ). Because almost nothing works as documented:
the SSDP discovery command will not work:
java -cp org.openhab.binding.samsungac-1.9.0.jar org.binding.openhab.samsungac.communicator.SsdpDiscovery
Error: Could not find or load main class org.binding.openhab.samsungac.communicator.SsdpDiscovery
The configuration file mentioned on that page (openhab.conf) no longer exists in OH2
The syntax for the configuration parameters seems to have changed. The wiki page mentions “samsungac:Livingroom.host=192.168.1.2”, but my /etc/openhab2/services/samsungac.cfg has lines like “Livingroom.host=192.168.1.2”
[Edit: I should have read the documentation more carefully - this is a known change in OH2 . However, it is still confusing for new users, and should be documented with the binding as well… ]
I have followed the steps here to trust my AC’s certificate and to create an “application” certificate for communicating with it. I was able to successfully connect to the AC, get a valid token, and send commands to it from the command line (MAC and token edited for obvious reasons):
openssl s_client -connect 192.168.1.2:2878 -cert /etc/openhab2/services/mycert.pem CONNECTED(00000003) --- <?xml version="1.0" encoding="utf-8" ?><Update Type="InvalidateAccount"/> <Request Type="AuthToken"><User Token="b6hgb657-ab78-4ae3-adc4-a3e7gh10ef5" /></Request> <?xml version="1.0" encoding="utf-8" ?><Response Type="AuthToken" Status="Okay" StartFrom="2017-01-30/12:17:31"/> <Request DUID="BA8DCD8GH43E" Type="DeviceState" /> <?xml version="1.0" encoding="utf-8" ?><Response Type="DeviceState" Status="Okay"> ... <Request Type="DeviceControl"><Control CommandID="cmd1" DUID="BA8DCD8GH43E"><Attr ID="AC_FUN_POWER" Value="On" /></Control></Request> <?xml version="1.0" encoding="utf-8" ?><Response Type="DeviceControl" Status="Okay" DUID="BA8DCD8GH43E" CommandID="cmd1"/>
However, I am unable to get the OpenHAB binding to work. I have added the config in /etc/openhab2/services/samsungac.cfg:
ACFirst.host=192.168.1.2 ACFirst.mac=BA8DCD8GH43E ACFirst.certificate=/etc/openhab2/services/mycert.pem ACFirst.token=b6hgb657-ab78-4ae3-adc4-a3e7gh10ef5
However, when I start OpenHab in debug mode (/usr/share/openhab2/start_debug.sh) and watch the logs, I get… absolutely nothing:
# grep onditioner /var/log/openhab2/openhab.log 2017-01-30 03:51:47.213 [INFO ] [b.core.service.AbstractActiveService] - Samsung Air Conditioner service has been started
What else do I need to do in order to get the binding to work?
As I mentioned before, I am VERY new to OpenHab, so please explain as clearly as possible