cyrilcc / org.openhab.binding.rflink

RFLink binding for OpenHAB 2.0
23 stars 32 forks source link

installation #15

Open 4noxx opened 6 years ago

4noxx commented 6 years ago

hello

how can i install and configure this addon?

johnjore commented 6 years ago

I personally created an OH2 dev environment and imported this plugin, made a few changes and then exported the plugin as a jar file to import to my main OH2 installation. There may be a quicker and simpler way to do this. When I get some time next weekend, I'll take a stab at incorporating the outstanding PR and put a copy of the resulting jar file on Dropbox and paste a link here.

Ps: its not complicated to do if you follow the guides.

4noxx commented 6 years ago

thx for your answer. i will wait for your dropbox-files and hope you can explain what i must do with this and how can i find and add my devices. regard

fab33 commented 6 years ago

It can be a good idea to publish Jar file on openhab marketplace Or here in the release.

4noxx commented 6 years ago

@johnjore any news?

regard

johnjore commented 6 years ago

eh... next weekend is in 4 days... So sorry no, no news.

4noxx commented 6 years ago

ups, sry :-)

fab33 commented 6 years ago

@johnjore : did you have time to make a jar ?

johnjore commented 6 years ago

I did find time to work on this, but there were problems committing the changes, so more work todo before I can create the JAR file. I'll need to wait until the weekend to continue working on this. See PR #17 for details.

johnjore commented 6 years ago

Looks like first half of the changes have been merged. I'll try to find time to process the 2nd half of the changes this weekend and generate a new jar file.

4noxx commented 6 years ago

thx

johnjore commented 6 years ago

A dev version of the binding can be found here: https://www.dropbox.com/s/ab7j8dz1m9itqi6/org.openhab.binding.rflink_2.2.0.201801210944.jar?dl=0

Its based on the yet to be committed PR #18

It worked for me; X10 (DS90) door/window sensors, RTS/Somfy blind, X10 Switch (On/Off) but ymmv.

JJ

PS: Seen random posts mixing me and cyrilcc. Please keep in mind that I'm not the maintainer of this binding. I just happen to use it and have been able to contribute to it.

fab33 commented 6 years ago

Doesn't work for me I already have a serial device (a MySensors gateway /dev/mysgw) working fine. For Rflink (dev/rflink) debug I have :

22:07:19.717 [DEBUG] [.rflink.internal.RfLinkHandlerFactory] - RfLinkHandlerFactory createHandler(rflink:bridge:usb0)
22:07:19.718 [DEBUG] [org.openhab.binding.rflink           ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.discovery.DiscoveryService}={service.id=363, service.bundleid=246, service.scope=singleton} - org.openhab.binding.rflink
22:07:19.719 [DEBUG] [ng.rflink.handler.RfLinkBridgeHandler] - Initializing RFLink bridge handler
22:07:19.720 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'rflink:bridge:usb0' changed from UNINITIALIZED to INITIALIZING
22:07:19.721 [DEBUG] [ng.rflink.handler.RfLinkBridgeHandler] - Checking RFLink transceiver connection, thing status = OFFLINE
22:07:19.721 [DEBUG] [ng.rflink.handler.RfLinkBridgeHandler] - Connecting to RFLink transceiver on /dev/rflink port
22:07:19.722 [DEBUG] [flink.connector.RfLinkSerialConnector] - RfLinkRxTxConnector()
22:07:19.722 [DEBUG] [flink.connector.RfLinkSerialConnector] - Disconnecting
22:07:19.722 [DEBUG] [flink.connector.RfLinkSerialConnector] - Closed
22:07:19.723 [DEBUG] [flink.connector.RfLinkSerialConnector] - connect(/dev/rflink)
22:07:19.723 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'rflink:bridge:usb0' changed from INITIALIZING to OFFLINE
22:07:19.723 [DEBUG] [flink.connector.RfLinkSerialConnector] - Found port : /dev/mysgw
22:07:19.724 [ERROR] [flink.connector.RfLinkSerialConnector] - Could not find COM port /dev/rflink
22:07:19.724 [ERROR] [ng.rflink.handler.RfLinkBridgeHandler] - Connection to RFLink transceiver failed: Could not find COM port /dev/rflink
22:07:19.726 [DEBUG] [.rflink.internal.RfLinkHandlerFactory] - RfLinkHandlerFactory createHandler(rflink:temperature:usb0:myTemperature)
22:07:19.727 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'rflink:temperature:usb0:myTemperature' changed from UNINITIALIZED to INITIALIZING
22:07:19.734 [DEBUG] [.binding.rflink.handler.RfLinkHandler] - Initializing thing rflink:temperature:usb0:myTemperature, deviceId=Tunex-D901
22:07:19.738 [DEBUG] [.binding.rflink.handler.RfLinkHandler] - initializeBridge OFFLINE for thing rflink:temperature:usb0:myTemperature

the Rflink works with a simple 'cat' command ... If I diable mysensors gateway it doesn't work too ... mysensors plugin use openhab-transport-serial like this binding.

fab33 commented 6 years ago

Ok finnaly it works by adding

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/mysgw:/dev/rflink"

strange that it deosn't needed for mysensors binding.

johnjore commented 6 years ago

Good that you got it working. Maybe your could add some details to the README.md file under configuration, like where the "EXTRA_JAVA_OPTS" is set, as others may also have this issue?

I personally have two RfLinks connected to a Raspberry Pi, and then use usbip to "move" the USB ports to a virtual machine, and I've had no issues for months. I can only guess there is something different with the USB-to-Serial chip used by your RfLink, compared to the MySensor one, and the Java library

4noxx commented 6 years ago

had try it with my intertechno switch. will not work

things: Bridge rflink:bridge:usb0 [ serialPort="/dev/serial/by-id/usb-Arduinowww.arduino.cc0042_8563431383935101A201-if00", baudRate=57600 ] { switch Kaku [ deviceId="arc-010af15e" ] }

item: Switch Kaku "Contact [%s]" {channel="rflink:switch:usb0:arc-010af15e:command"}

old mqtt-log: rflink/NewKaku/010af15e/R/message 20;48;NewKaku;ID=010af15e;SWITCH=1;CMD=ON;

johnjore commented 6 years ago

Your config appears wrong, especially the name of the "thing", Kaku. Re-read the documentation, maybe add the X10 switch from there to your setup and make sure logging is enabled for the module and try again.

The log file will show what RfLink is doing, the commands sent to it, and the response received back, for your device and one from the documentation.

I suspect this might work; is a copy of the X10 config shown in the example: switch arc-010af15e-1 [ deviceId="arc-010af15e-1" ]

4noxx commented 6 years ago

hmm, problem to connect to my rflink

2018-01-27 16:46:41.641 [ERROR] [g.rflink.handler.RfLinkBridgeHandler] - Connection to RFLink transceiver failed: Could not find COM port /dev/serial/by-id/usb-Arduinowww.arduino.cc0042_8563431383935101A201-if00

4noxx commented 6 years ago

RFLINK works now 2018-01-27 17:35:44.574 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'rflink:switch:usb0:NewKaku_010af15e_1' to inbox

but not my switches :-( nothings happens

.thing: Bridge rflink:bridge:usb0 [serialPort="/dev/ttyACM0", baudRate=57600 ] { switch Kaku [ deviceId="NewKaku_010af15e_1" ] }

.items: Switch Kaku "Contact [%s]" {channel="rflink:switch:usb0:NewKaku_010af15e_1:command"}

johnjore commented 6 years ago

Same problem here as others have, in that the protocol is not included as part of the device name. See readme.md file for details. Without this information, the binding does not know what protocol to tell the rflink to use when sending a command. See my example in my post on Jan 27th.

There are at least two possible workarounds for this: 1) Update the discovery process to include the protocol as part of the name 2) Find a way to read the deviceId at runtime and extract the protocol information

Feel free to update the plugin with any of these two to resolve this problem for "everyone". I personally dont have the time as there is a workaround documented in the readme.md file...

ninjax95 commented 6 years ago

Please, I not find the tutorial for install to openhab2, Can you help me ? Thanks

Leemur89 commented 5 years ago

I know this is an old topic but I struggled a lot for the installation so I thought I could share my findings with everyone:

There is a Travis job here (jar file is automatically built uppon each commit here) https://github.com/cartemere/org.openhab.binding.rflink/releases Go to asset and download the jar file. Place it in the openhab add-on folder

Then you need to add openhab user to tty and dialout groups.

Finally, update the openhab config file /etc/default/openhab2 by adding

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"

Tontze commented 4 years ago

I know this is an old topic but I struggled a lot for the installation so I thought I could share my findings with everyone:

There is a Travis job here (jar file is automatically built uppon each commit here) https://github.com/cartemere/org.openhab.binding.rflink/releases Go to asset and download the jar file. Place it in the openhab add-on folder

Then you need to add openhab user to tty and dialout groups.

Finally, update the openhab config file /etc/default/openhab2 by adding

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"

Howdo you do this in windows ?

cartemere commented 4 years ago

There is a workaround using the UI to install the mandatory SerialPort support. Go to : Paper UI > Addons > Binding and install the "Serial Button" binding in the list.

This binding adds support for third party remote buttons & triggers using serial connection, but also installs the SerialPort support to do so ;)

then you can copy the RFLink binding jar into the OpenHab plugin folder and it should work fine out of the box.

Thomas

Le ven. 14 févr. 2020 à 19:33, Tontze notifications@github.com a écrit :

I know this is an old topic but I struggled a lot for the installation so I thought I could share my findings with everyone:

There is a Travis job here (jar file is automatically built uppon each commit here) https://github.com/cartemere/org.openhab.binding.rflink/releases Go to asset and download the jar file. Place it in the openhab add-on folder

Then you need to add openhab user to tty and dialout groups.

Finally, update the openhab config file /etc/default/openhab2 by adding

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"

Howdo you do this in windows ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cyrilcc/org.openhab.binding.rflink/issues/15?email_source=notifications&email_token=AKBGQAIIW2LQ5WBACAMOSS3RC3PXJA5CNFSM4EKOEXS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELZ7QYA#issuecomment-586414176, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBGQAPWM2CRWVW2YSMA3M3RC3PXJANCNFSM4EKOEXSQ .

johnjore commented 4 years ago

If using Docker, I added this: -Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyUSB1"