Interest in a homeduino binding

So i finally pulled the trigger and updated my OH to v2.
Since i could find no instructions on how to install the binding I added the .jar to the addons directory and restarted OH2.
I got this:

2017-02-11 21:08:14.490 [ERROR] [org.openhab.binding.homeduino       ] - FrameworkEvent ERROR - org.openhab.binding.homeduino
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.homeduino [225]
  Unresolved requirement: Import-Package: gnu.io

        at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]

What does it mean?
Could anyone post some install and configurations instructions?

THX

Installing RFXCOM binding solved my problem, but it came back after i uninstalled the binding as i donā€™t use it.
Looking more into it i found this:


so i entered feature:install openhab-transport-serial into karaf console and now there is no more error.
However this should be addressed in future versions

Also why canā€™t i select pin D2 for receiving but only D1 or D0?

I can not find restriction for the pin number in the configuration of the transreciever. Every number is possible. Did you configure the homeduino binding over the paper ui?

I indeed restricted it, I somehow thought it should be limited, what values should be available then?

Starts receiving 433 mhz RF signals on interrupt pin interrupt_pin using 
RFControl. interrupt_pin can be 0 or 1.

oh thats true, I looked at the transmitter pinā€¦

You are right martin ā€¦ Sorry ā€¦ this was oversight on my side ā€¦

OK so for anyone else looking for instructions, hereā€™s how i got it working;

Copy the jar file to the addons folder and restart openhab sudo systemctl restart openhab2
check the openhab.log file to see if you get any errors. if you get an error:

2017-02-11 21:08:14.490 [ERROR] [org.openhab.binding.homeduino       ] - FrameworkEvent ERROR - org.openhab.binding.homeduino
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.homeduino [225]
  Unresolved requirement: Import-Package: gnu.io

You need to install gnu.io library which can be installed by entering the karaf console and entering:feature:install openhab-transport-serial
restart openhab

you should now see Homeduino 433.92MHz Tranciever thing in your inbox to be able to use it, make sure to add user openhab to the dialout group:
sudo usermod openhab -a -G dialout
restart openhab

Serial port should be entered like /dev/ttyUSB0

@martinvw i noticed you mentioned somewhere that users should add usb device to start-stop script of openhab - could you elaborate on that?

I am not sure whether the same holds for OH2

So i guess this has to do with systems using more than one USB device.

@martinvw
I downloaded the latest binding and pressing the remotes fills my inbox with new things ā€¦
Am i correct in assuming that this is the correct way to add a new item:
Rollershutter TestShutters {channel="homeduino:shutter3:32466789:65542026_1:shutter"} ?

Beacause my karaf console shows:

openhab> smarthome:things
homeduino:shutter3:32466789:65542026_1 (Type=Thing, Status=ONLINE, Label=SHUTTER3-65542026.1, Bridge=homeduino:homeduino:32466789)
homeduino:homeduino:32466789 (Type=Bridge, Status=ONLINE, Label=Homeduino 433.92MHz Tranciever, Bridge=null)

openhab> smarthome:items list TestShutters
TestShutters (Type=RollershutterItem, State=NULL, Label=null, Category=null)

But log shows something happening:

2017-02-11 23:35:16.277 [DEBUG] [rnal.connector.HomeduinoStreamReader] - Received message: 524620726563656976652035333034203136383020333630203733322031303433362030203020302030313233323332333332333233323332333232333332323332333233323332333233333232333332333233323332323332333233333232333332323332333233333232333233323333323233323332333334
2017-02-11 23:35:16.279 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (null): RF receive 5304 1680 360 732 10436 0 0 0 0123232332323232322332232323232323322332323232232323322332232323322323233223232334
2017-02-11 23:35:16.282 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received message from bridge: homeduino:homeduino:32466789 message: org.openhab.binding.homeduino.internal.messages.homeduino.Shutter3Message@1b7b645
2017-02-11 23:35:16.520 [DEBUG] [rnal.connector.HomeduinoStreamReader] - Received message: 5246207265636569766520353233362031353830203336302037333220343434203130393238203020302030313233323332333332333233323332333432333332323332333233323332333233333232333332333233323332323332333233333232333332323332333233333432333233323333323332333233323235
2017-02-11 23:35:16.522 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (null): RF receive 5236 1580 360 732 444 10928 0 0 0123232332323232342332232323232323322332323232232323322332232323342323233232323225
2017-02-11 23:35:16.527 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received message from bridge: homeduino:homeduino:32466789 message: org.openhab.binding.homeduino.internal.messages.homeduino.Shutter3Message@4dfe2c
2017-02-11 23:35:21.081 [DEBUG] [rnal.connector.HomeduinoStreamReader] - Received message: 524620726563656976652035313438203136383420333634203732382031303434382030203020302030313233323332333332333233323332333232333332323332333233323332333233333232333332333233323332323332333233333232333332323332333233333232333332323333323233333232333334
2017-02-11 23:35:21.087 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (null): RF receive 5148 1684 364 728 10448 0 0 0 0123232332323232322332232323232323322332323232232323322332232323322332233223322334
2017-02-11 23:35:21.091 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received message from bridge: homeduino:homeduino:32466789 message: org.openhab.binding.homeduino.internal.messages.homeduino.Shutter3Message@1f6be83
2017-02-11 23:35:25.822 [DEBUG] [rnal.connector.HomeduinoStreamReader] - Received message: 524620726563656976652035333034203136393220333634203733322031303437322030203020302030313233323332333332333233323332333232333332323332333233323332333233333232333332333233323332323332333233333232333332323332333233333232333233333233323233323333323334
2017-02-11 23:35:25.824 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (null): RF receive 5304 1692 364 732 10472 0 0 0 0123232332323232322332232323232323322332323232232323322332232323322323323223233234
2017-02-11 23:35:25.830 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received message from bridge: homeduino:homeduino:32466789 message: org.openhab.binding.homeduino.internal.messages.homeduino.Shutter3Message@14b6df3
2017-02-11 23:35:26.066 [DEBUG] [rnal.connector.HomeduinoStreamReader] - Received message: 524620726563656976652035323434203137353620333634203733322031303737322030203020302030313233323332333332333233323332333232333332323332333233323332333233333232333332333233323332323332333233333232333332323332333233333232333233333233323332333232333234
2017-02-11 23:35:26.068 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (null): RF receive 5244 1756 364 732 10772 0 0 0 0123232332323232322332232323232323322332323232232323322332232323322323323232322324
2017-02-11 23:35:26.071 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received message from bridge: homeduino:homeduino:32466789 message: org.openhab.binding.homeduino.internal.messages.homeduino.Shutter3Message@15aee01

(this is UP, STOP, DOWN each pressed once)
What am i missing?

It was supposed to at least support receiving shutter3, Iā€™m currently looking at the tests I have for it, let me check it with your new logging.

Canā€™t you just add them via the inbox, Iā€™m not yet comfortable with the new syntax so I donā€™t know whether its correct. Especially the _ in 65542026_1 makes me doubt whether that will work out fine.

The output you posted is not harmful it should just work with correct configuration, however I should improve my logging I even convinced my self that was not good :blush:

I just created a new update which might even support sending the signals, it looks more or less compatible with the output via pimaticā€¦

outdated download

will try the new snapshot.
TBH - i havenā€™t grasped the concept of how one is supposed to link things to items using the inbox :
but if i understand correctly: I should first add a thing for each remote and add item and link that item to a thing?

I believe you can create items straight when linking the channels of a thing, but please correct me if iā€™m wrong :slight_smile:

So Iā€™ve gone and removed the item in the .items file and recreated a new item by first adding a thing, and then linking a thing an item by creating a new item. (Iā€™ve confimed this method works by adding a new item switch2 which works perfectly)
the item now shows in list

openhab> smarthome:items list SHUTTER3655420261_*
SHUTTER3655420261_Shutter (Type=RollershutterItem, State=NULL, Label=Shutter, Category=null)

Here is the debug log capture for commands UP,STOP and DOWN:

UP
2017-02-12 09:35:03.887 [DEBUG] [rnal.connector.HomeduinoStreamReader] - Received message: 524620726563656976652035303736203136313620333238203636302031303530342030203020302030313233323332333332333233323332333232333332323332333233323332333233333232333332333233323332323332333233333232333332323332333233333232333233323333323233323332333334
2017-02-12 09:35:03.892 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (null): RF receive 5076 1616 328 660 10504 0 0 0 0123232332323232322332232323232323322332323232232323322332232323322323233223232334
2017-02-12 09:35:03.900 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received message from bridge: homeduino:homeduino:32466789 message: org.openhab.binding.homeduino.internal.messages.homeduino.Shutter3Message@1781eba
STOP
2017-02-12 09:35:12.111 [DEBUG] [rnal.connector.HomeduinoStreamReader] - Received message: 524620726563656976652035303736203136313620333332203635362031303530382030203020302030313233323332333332333233323332333232333332323332333233323332333233333232333332333233323332323332333233333232333332323332333233333232333332323333323233333232333334
2017-02-12 09:35:12.114 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (null): RF receive 5076 1616 332 656 10508 0 0 0 0123232332323232322332232323232323322332323232232323322332232323322332233223322334
2017-02-12 09:35:12.121 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received message from bridge: homeduino:homeduino:32466789 message: org.openhab.binding.homeduino.internal.messages.homeduino.Shutter3Message@447cbf
DOWN
2017-02-12 09:35:19.353 [DEBUG] [rnal.connector.HomeduinoStreamReader] - Received message: 524620726563656976652035303736203136313620333332203635362031303532342030203020302030313233323332333332333233323332333232333332323332333233323332333233333232333332333233323332323332333233333232333332323332333233333232333233333233323233323333323334
2017-02-12 09:35:19.356 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (null): RF receive 5076 1616 332 656 10524 0 0 0 0123232332323232322332232323232323322332323232232323322332232323322323323223233234
2017-02-12 09:35:19.363 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received message from bridge: homeduino:homeduino:32466789 message: org.openhab.binding.homeduino.internal.messages.homeduino.Shutter3Message@169a973

These captures differ slightly from my previous ones as these are generated by my 433 shutter control python script (shutters respond to these commands). Iā€™m posting these as they might help debugging, since the original remote control sends out two codes for up and down (UP pressed once gives commands from 23:35:16.277 - 23:35:16.527 and DOWN pressed once gives 23:35:25.822- 23:35:26.071)

The item state however remains unchanged

openhab> smarthome:items list SHUTTER3655420261_*
SHUTTER3655420261_Shutter (Type=RollershutterItem, State=NULL, Label=Shutter, Category=null)

EDIT:
I can also confirm that the manual method iā€™ve used to add items in .items file also works - you can use this way to add new items (Coming form 1.x i feel this manual approach gives me much more control over my items):
Switch TestSwitch2 {channel="homeduino:switch2:32466789:3_8:command"} where homeduino:switch2:32466789:3_8:command is command channel you select in the things view in paperUI.
This is in mine;

SWITCH2-3.8

Homeduino Switch2 Actuator

A Switch2 device.

Status: ONLINE
Channels
Command

homeduino:switch2:32466789:3_8:command

Command channel


Contact

homeduino:switch2:32466789:3_8:contact

Contact channel

this is the event log when i press the remotes;

2017-02-12 10:00:44.292 [ItemStateChangedEvent     ] - SWITCH238_Command changed from OFF to ON
2017-02-12 10:00:44.295 [ItemStateChangedEvent     ] - TestSwitch2 changed from NULL to ON
2017-02-12 10:00:53.878 [ItemStateChangedEvent     ] - TestSwitch2 changed from ON to OFF
2017-02-12 10:00:53.885 [ItemStateChangedEvent     ] - SWITCH238_Command changed from ON to OFF
2017-02-12 10:01:04.159 [ItemStateChangedEvent     ] - TestSwitch2 changed from OFF to ON
2017-02-12 10:01:04.166 [ItemStateChangedEvent     ] - SWITCH238_Command changed from OFF to ON

SWITCH238_Command was created by linking via PaperUI and TestSwitch2 by adding the above in the .items file.

I think that I failed to add shutter as valid input for the shutter3ā€¦ I made some improvements which should make this better outdated download

Are you sure this is pir1, the timings do not match with what i see in rfcontrol:

pulseLengths: [ 358, 1095, 11244 ]
source

It works!
Pressing Up
event.log

2017-02-12 14:00:40.623 [ItemStateChangedEvent     ] - SHUTTER3655420261_Shutter changed from 100 to 0

down gives

2017-02-12 14:01:28.265 [ItemStateChangedEvent     ] - SHUTTER3655420261_Shutter changed from 0 to 100

however STOP gives:

2017-02-12 14:01:29.624 [ItemStateChangedEvent     ] - SHUTTER3655420261_Shutter changed from 100 to UNDEF

which i donā€™t understand? Why does pressing stop key return UNDEF state?
If i press the stop button in the GUI i get this in event log:

2017-02-12 14:15:19.627 [ItemCommandEvent          ] - Item 'SHUTTER3655420261_Shutter' received command DOWN
2017-02-12 14:15:19.855 [ItemStateChangedEvent     ] - SHUTTER3655420261_Shutter changed from 0 to 100
2017-02-12 14:15:22.591 [ItemCommandEvent          ] - Item 'SHUTTER3655420261_Shutter' received command UP
2017-02-12 14:15:24.027 [ItemStateChangedEvent     ] - SHUTTER3655420261_Shutter changed from 100 to 0
2017-02-12 14:15:26.172 [ItemCommandEvent          ] - Item 'SHUTTER3655420261_Shutter' received command STOP

It looks like there is a command STOP available in eclipse smarthome, but no state. So we can receive a command STOP, which means that the state is not any longer up/down. We are able to send a stop however because it is available as a command. I had to think long about it but it seems to make sense in my head.

Huh ā€¦ but this will cause the shutters states to go to UNDEF state if i press the stop button on the remote but not if i press the stop button in the interface - maybe this should be approached in another way ā€¦(or maybe somehow programmatically change that with rules ā€¦)

Iā€™m currently testing the sending part ā€¦

Thanks for everything up so far!!!

EDIT:
So the sending doesnā€™t seem to work ā€¦ i connected another homeduino to my PC and it doesnā€™t receive anything when i press the buttons in UI
however if i press Up the log shows

2017-02-12 14:40:30.466 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received channel: homeduino:shutter3:32466789:65542026_1:shutter, command: UP
2017-02-12 14:40:30.476 [DEBUG] [l.connector.HomeduinoSerialConnector] - Sending message: RF send 4 3 366 736 1600 5204 10896 0 0 0 3201010110101010100110010101010101100110101010010101100110010101100101011001010104
2017-02-12 14:40:30.680 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (HOMEDUINO_ACK): ACK
2017-02-12 14:40:30.682 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Response received: org.openhab.binding.homeduino.internal.messages.HomeduinoAcknowledgementMessage@a5872b
2017-02-12 14:40:30.686 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Command successfully transmitted, 'ACK' received

If i press DOWN:

2017-02-12 14:41:43.200 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received channel: homeduino:shutter3:32466789:65542026_1:shutter, command: DOWN
2017-02-12 14:41:43.204 [DEBUG] [l.connector.HomeduinoSerialConnector] - Sending message: RF send 4 3 366 736 1600 5204 10896 0 0 0 3201010110101010100110010101010101100110101010010101100110010101100101101001011004
2017-02-12 14:41:43.407 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (HOMEDUINO_ACK): ACK
2017-02-12 14:41:43.409 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Response received: org.openhab.binding.homeduino.internal.messages.HomeduinoAcknowledgementMessage@11a16aa
2017-02-12 14:41:43.410 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Command successfully transmitted, 'ACK' received

STOP:

2017-02-12 14:42:03.416 [DEBUG] [ding.homeduino.handler.RFXComHandler] - Received channel: homeduino:shutter3:32466789:65542026_1:shutter, command: STOP
2017-02-12 14:42:03.421 [DEBUG] [l.connector.HomeduinoSerialConnector] - Sending message: RF send 4 3 366 736 1600 5204 10896 0 0 0 3201010110101010100110010101010101100110101010010101100110010101100110011001100104
2017-02-12 14:42:03.624 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Message received (HOMEDUINO_ACK): ACK
2017-02-12 14:42:03.626 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Response received: org.openhab.binding.homeduino.internal.messages.HomeduinoAcknowledgementMessage@2f1369
2017-02-12 14:42:03.628 [DEBUG] [duino.handler.HomeduinoBridgeHandler] - Command successfully transmitted, 'ACK' received

I took the code and tried sending via terminal on second homeduino and if i increase sending to 6 i can get the openhab homeduino to recognize the code in the log but with repeat =3 it doesnā€™t.
EDIT2: i checked and verified if i replay the captured signal form remote eith REPEAT=3 shutters respond.
My shutters however donā€™t react to this code.

Shutters work with:RF send 4 3 5284 1676 368 728 10776 0 0 0 0123232332323232322332232323232323322332323232232323322332232323322323323232322324

but not
2017-02-12 14:48:20.039 [DEBUG] [l.connector.HomeduinoSerialConnector] - Sending message:
RF send 4 3 366 736 1600 5204 10896 0 0 0 3201010110101010100110010101010101100110101010010101100110010101100101101001011004

hmm maybe someone else no how this is handled by other bindings?

I just updated the code to include support for weather1 and I solved the null-pointer, unfortunately I cannot support the message which causes the problem but I can handle it gracefully.:

[org.openhab.binding.homeduino-2.1.0-SNAPSHOT.jar.zip]

If everything is still working okay, I could use some help on writing a readme and if someone could help me with an ordered list of protocols which should be supported that would also be great,

Iā€™m happy to help you out with the readme. what did you have in mind?
perhaps the ā€œtutorialā€ i published few posts earlier could be a starting point?