[SOLVED] Openabian2 nanoCUL Intertechno self learning plugs not working with serial binding

Hello all,

i’m new to Openhab2 an need your advice.
I try to use the Intertechno selflearning plugs ITR-1500 in conjunction with an selfmade nanoCul and Openhabian. First fiddeld around with the intertechno binding, but honestly, i’ve no clue how to configure the addresses of the plugs, they have no DIP-Switches to determine the addresses.
The nanoCul is working perfectly, i can read the commands sent from the RC ITT-1500 in a minicom-Terminal and converted the output of the nanoCul with a script from Christian Rinn back to raw nanoCul-commands. Issuing these commands via minicom to the nanoCul, and, voila, the plugs can be switched on and off.

Next i deinstalled the interchno binding an install the serial binding via the PaperUI.
Now i changed the start.sh script with

-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0

which ist the port of the nanoCul.

Then i created the .items, .things and .sitemap files in /etc/openhab2/…

home.items

Switch Funkstecker "Funkstecker IT Test" (Test) {  serial="/dev/ttyUSB0@38400,ON(is01010110000100010110010110010010\n),OFF(is01010110000100010110010110000010\n)" }

home.sitemap

sitemap home label="MK-SmartHouse"

{
       Frame label="Demo"

       {
         Switch item=Funkstecker
       }
}

The home.things file is empty

After reboot of the pi i see the switch in the basic UI, but nothing happens using it.

There is no error entry in openhab.log.
Is there something i missed?

Thanks in advance for your help…

Greetings, Oliver

Try to increase the log level for the serial binding to see if you get more info.
Use the openHAB2 console (ssh openhab@localhost -p 8101 with password: habopen)

log:set DEBUG org.openhab.binding.serial

and monitor /var/log/openhab2/openhab.log

Have restarted the Service openhab2. Here is the events.log

2017-06-17 11:02:00.354 [ThingAddedEvent           ] - Thing 'network:device:192_168_1_1' has been added.
2017-06-17 11:02:00.367 [ThingAddedEvent           ] - Thing 'network:device:192_168_1_128' has been added.
2017-06-17 11:02:00.379 [ThingAddedEvent           ] - Thing 'network:device:192_168_1_54' has been added.
2017-06-17 11:02:00.386 [ThingAddedEvent           ] - Thing 'network:device:192_168_1_21' has been added.
2017-06-17 11:02:00.392 [ThingAddedEvent           ] - Thing 'network:device:192_168_1_53' has been added.
2017-06-17 11:02:00.399 [ThingAddedEvent           ] - Thing 'network:device:192_168_1_46' has been added.
2017-06-17 11:02:00.405 [ThingAddedEvent           ] - Thing 'network:device:192_168_1_57' has been added.
2017-06-17 11:02:04.925 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_1' changed from UNINITIALIZED to INITIALIZING
2017-06-17 11:02:04.984 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_1' changed from INITIALIZING to ONLINE
2017-06-17 11:02:04.993 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_128' changed from UNINITIALIZED to INITIALIZING
2017-06-17 11:02:05.022 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_128' changed from INITIALIZING to ONLINE
2017-06-17 11:02:05.036 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_54' changed from UNINITIALIZED to INITIALIZING
2017-06-17 11:02:05.052 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_54' changed from INITIALIZING to ONLINE
2017-06-17 11:02:05.075 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_21' changed from UNINITIALIZED to INITIALIZING
2017-06-17 11:02:05.082 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_21' changed from INITIALIZING to ONLINE
2017-06-17 11:02:05.116 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_53' changed from UNINITIALIZED to INITIALIZING
2017-06-17 11:02:05.124 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_53' changed from INITIALIZING to ONLINE
2017-06-17 11:02:05.157 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_46' changed from UNINITIALIZED to INITIALIZING
2017-06-17 11:02:05.160 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_46' changed from INITIALIZING to ONLINE
2017-06-17 11:02:05.200 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_57' changed from INITIALIZING to ONLINE
2017-06-17 11:02:05.205 [hingStatusInfoChangedEvent] - 'network:device:192_168_1_57' changed from UNINITIALIZED to INITIALIZING
2017-06-17 11:03:42.237 [ItemCommandEvent          ] - Item 'Funkstecker' received command ON
2017-06-17 11:03:42.260 [ItemStateChangedEvent     ] - Funkstecker changed from NULL to ON
2017-06-17 11:03:55.068 [ItemCommandEvent          ] - Item 'Funkstecker' received command OFF
2017-06-17 11:03:55.076 [ItemStateChangedEvent     ] - Funkstecker changed from ON to OFF

and here is openhab.log

2017-06-17 11:01:51.980 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.items'
2017-06-17 11:01:58.913 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.sitemap'
2017-06-17 11:01:59.756 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'home.things'
2017-06-17 11:01:59.823 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'home.things' is either empty or cannot be parsed correctly!
2017-06-17 11:02:02.538 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at /start
2017-06-17 11:02:04.117 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2017-06-17 11:02:04.357 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2017-06-17 11:02:04.489 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel
2017-06-17 11:02:05.048 [DEBUG] [org.openhab.binding.serial          ] - BundleEvent STARTING - org.openhab.binding.serial
2017-06-17 11:02:05.057 [DEBUG] [ding.serial.internal.SerialActivator] - Serial binding has been started.
2017-06-17 11:02:05.247 [DEBUG] [binding.serial.internal.SerialDevice] - Serial port '/dev/ttyUSB0' has been found.
2017-06-17 11:02:05.286 [DEBUG] [org.openhab.binding.serial          ] - ServiceEvent REGISTERED - {org.openhab.model.item.binding.BindingConfigReader, org.osgi.service.event.EventHandler}={event.topics=openhab/command/*, component.name=org.openhab.binding.serial, TransformationService.target=(openhab.transform=REGEX), component.id=160, service.id=288, service.bundleid=191, service.scope=bundle} - org.openhab.binding.serial
2017-06-17 11:02:05.290 [DEBUG] [org.openhab.binding.serial          ] - BundleEvent STARTED - org.openhab.binding.serial

Maybe openhab serial using the wrong communication parameters? I did not found any hint to change them…

This are the parameters minicom work with:

    +-----------------------------------------------------------------------+
    | A -    Serial Device      : /dev/ttyUSB0                              |
    | B - Lockfile Location     : /var/lock                                 |
    | C -   Callin Program      :                                           |
    | D -  Callout Program      :                                           |
    | E -    Bps/Par/Bits       : 38400 8N1                                 |
    | F - Hardware Flow Control : No                                        |
    | G - Software Flow Control : No                                        |
    |                                                                       |
    |    Change which setting?                                              |
    +-----------------------------------------------------------------------+

The nanoCul indicates no communication with the LEDs for Openhab, issued the commands with minicom the red and the yello LEDs flashing …

Why did you give up on the IntertechnoBinding, just because you can’t get addresses configured? Did you look here That’S a page in German which explains different types of those switches which all use some kind of “intertechno”-like code. Your ITR-1500 is in there as well.
I’m using rather old switches (not 26Bits like ITR-1500), however my channel-setting for a switch looks and works like:

Switch Elro_OutDoor "Elro-OutDoor" (gLichtschalter) {culintertechno="type=raw;address=0000FFFF0F;commandOn=FF;commandOff=F0"} /* Intertechno Code A16 Elro Outdoor */
S

Thanks! It works!

If tried the intertechno binding once more. The following config suceeded:

  1. added to the /etc/openhab2/services/culintertechno.cfg baudrate and parity
############################# Intertechno Binding ###################################
# Devicename to use (mandatory)
# Example /dev/ttyACM0
device=serial:/dev/ttyUSB0
baudrate=38400
parity=NONE

# How often should the command be repeated? (optional)
# See http://culfw.de/commandref.html for details
repetitions=6

# How long should one pulse be? (optional)
# See http://culfw.de/commandref.html for details
wavelength=420

then created a new itemsfile in /etc/openhab2/items

Switch Funkstecker "Funkstecker IT Test" (Test) { culintertechno="type=raw;address=01010110000100010110010110;commandOn=010010;commandOff=000010" }
Switch Stehlampe "Stehlampe Wohnzimmer" (Test) { culintertechno="type=raw;address=01010110000100010110010110;commandOn=010000;commandOff=000000" }
Dimmer Dimmer1 "Dimmer" (Test) { culintertechno="type=raw;address=01010110000100010110010110;commandOn=010001;commandOff=000001" }

and customized the /etc/openhab2/sitemaps/home.sitemap file

sitemap home label="MK-SmartHouse"

{
   Frame label="Demo"
       {
         Switch item=Funkstecker
       }
   Frame label="Demo"

       {
              Switch item=Stehlampe
           }
       Frame label="Demo"

          {
              Switch item=Dimmer1
          }
}

For reference purposes here the complete procedure:

  1. Connect your nanoCul to your openhab-computer
  2. determine the correct USB port
  3. tweak the start.sh with the correct “-Dgnu.io.rxtx.SerialPorts=/dev/ttyXXXXX”
  4. connect to nanoCUL with minicom (Com-Parameters mentioned above)
  5. Set the nanoCul with “X21” to reporting mode
  6. Use your remote control, the nanCul reports the codes.
  7. let the script “cul_decode_itv3.py” decode the nanoCul-answers
  8. Create Items like above,match your sitemap
  9. Have fun!

:+1:
Great you got it running.
What makes me wonder is the required change in start.sh!
I’m on openhabian and had to do no change at all beside the .cfg file.

I think it depends what type of CUL your running. Some of them seems to appear on a different tty.