CUL via Intertechno binding

Hello all together,

this is my first post in this formus, because now i really nead some help of you.

Maybe someone of you can help me. I build my own nanoCUL 433Mhz to control some cheap devices with DIP-shifter. Now I can send via “screen” over the terminal on the pi the signal to switch devices on and off. Now I trie it to do that over openhab. I prepare the openhab.config that everything looks ok. Now when l change the status of the switch in openhab, the logfile tells me that the comand was sent to the nanoCUL wich is connected. But nothing happends. When I have a look in the “screen” there is nothing happend. So it looks like, thet the command do not reache my nanoCUL.

Maybe someone of you can give me an clue, that I can also send the commad via openhap to my devices.

Thanks a lot for your help!

Greetings from Munich
Dennis

Hey guys,

I tried some different things to solve my problem. Now openhab is sending the command. Here is the log-file from openhab in debugging-mode:
23:06:15.322 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:312 ] - Sending raw message to CUL /dev/ttyUSB0: 'is00FF0FF0FFFF

23:06:15.324 [DEBUG] [o.o.i.t.c.i.AbstractCULHandler:296 ] - Requesting credit report
23:06:15.321 [INFO ] [runtime.busevents :22 ] - KL_AQUA_Futter received command ON

After a while I found this also in the log-file from openhab:
23:06:52.894 [DEBUG] [.o.b.i.i.CULIntertechnoBinding:134 ] - execute() method is called!

I found the last log approximatly every 10 minutes in my log-file. But nothing happends to my devices. Also the LED on the nanoCUL doesn’t blink. I can’t see the problem. Maybe is the word wrap after the directly after “is00FF0FF0FFFF” the problem? But there isn’t any option to delete this word wrap.

Maybe someone else can have a look in your log file if it looks the same like my one? Hopefully someone else can give me a hint, what the problem could be.

Greetings
Dennis

Hi Dennis,

I’ve faced exactly the same issues how exactly is your config defined?
Please take care that a specific .cfg file each have to be created in oh2.
Please see my post here:

Greetings from Dachau :wink:

Hi @De_nn_is,
I’ve given up to use the CUL via Intertechno binding because I didn’t get it running at all.
I found the following workaround which works perfectly for me:

You need the following script. I called it sendtoCUL.sh:

#!/bin/sh
echo $1 > /dev/ttyUSB0

Place the script under /etc/openhab2/scripts (or where ever you like; but placing it there will backup the script as well when you backup the config directory) and make sure it is executable (chmod +x) and change the group and owner to the user openhab (chgrp, chown) - unless your instance is running as root.

Then you only need to define the item, in my case:

Switch CUL_WZ_Licht_TV          "Licht TV"                       { exec=">[ON:sudo sh /etc/openhab2/scripts/sendtoCUL.sh is000000000fff] >[OFF:sudo sh /etc/openhab2/scripts/sendtoCUL.sh is000000000ff0]"}

Finally, define the switch in the sitemap:

Switch item=CUL_WZ_Licht_TV mappings=[ON="ON",OFF="OFF"]

That’s it!

Maybe there are more elegant solutions available, but this one works flawless for weeks now.
And you don’t have to worry about CUL config, baudrate settings and stuff like that (which made me crazy for almost three weeks)

Best wishes from Austria,
Robert

Hey Robert,

that looks like a great solution for me! I will try it and give som feedback if it works or not. Thanks a lot!

Greetings from Munich to Austria
Dennis

1 Like

Hey Robert,

that works really perfekt. Now it is possible to send the command to the device. Do you know if there is also an option to receive some commands to the openhab for example from the intertechno remote control?

Best greetings
Dennis

1 Like

Hi @Bruno_Eichler ,

I saw your post in this forum. But i decided to make a new thread because I’m using OH1 and i woudn’t mix it together. You are alway intersted in my config from OH1 or do you find a solution for OH2?

Greetings from Munich to Dachau (for non-germans it ist only 30km) :wink:
Dennis

Hi Dennis, ok sorry somehow I didn’t catch the point that you are focusing the OH1 version, in that case of cause above described solution is perfectly fitting.
My setup is working well and the solution how to get there I wrote in the other threads so not necessary to share them here I think.
(Just now I get enocean so far even run :slight_smile:)

Enjoy now the working setup :smiley: !

Well, there is such an option, but I haven’t realized it myself until now.
You just need to read data from the serial port via the serial binding; don’t forget to…

  • put the CUL in “reporting mode” (send “X25” to the CUL stick)
  • watch the correct connection settings (38400/8/N/1) for the correct port in the serial binding
    You’ll get everything via the serial port which is being aired by any device; you will need rules to distinguish between the commands you want to process - and those you won’t.

THEORETICALLY you should be able then to read data from the serial binding. But haven’t tried it before myself…

Be aware, if you use the CUL stick in the serial binding, it cannot be used by other bindings anymore (because it’s assigned exclusively to one binding).
To find this out, did cost me two nights of desperate search (because you get a “device not available” error message).

Cheers,
Boby

Hey @Boby,

the last time a tried a lot in communication with my Pi and the Arduino. You give me the clue to use a script for sending to intertechno. But i think that is not working. In my last post I said it works but that was a mistake by myself. It doesn’t work because I think in you example ist missing the baudrate. Do you have any idea that i can send via script in the echo also the correct baudrate?

Greetings
Dennis

Hi @De_nn_is,
have you tried to start the script from OS level?
I don’t think it’s a baudrate problem - I haven’t set the baudrate either and it worked from the very frist beginning.

Have you added the user openhab to the group dialout?

  • Boby

Hi @Boby,

no I don’t tried it from the OS level. What is the correct way to do this? The last days I used my time to communicate via javascript and not via bash. That is the reason, why I don’t know how I can do this.

openhab has the authority to send data and is added to the group dailout.

Greetings
Dennis

Just execute the part of the exec command to run on the command line which is inside the quotes:

sudo sh /etc/openhab2/scripts/sendtoCUL.sh is000000000fff

(this code is for a receiver group A, swich 1)

Important: When you do it from OS level, then you’re not running under the user openhab, but pi or root (depends on how you log on). If not root, add your user also to the dialout group.

When you’re able to trigger the Intertechno receiver, the problem is not between the script and the receiver, but between OH2 and your script.

If the test from OS level works, you need to execute the command via rule in order to find out, what’s the error:

rule TEST
     when 
          Item CUL_WZ_Licht_TV received command
     then 
          if ((receivedCommand)== ON) 
                  {
                  val String results = executeCommandLine("sudo sh /etc/openhab2/scripts/sendtoCUL.sh is000000000fff", 5000)
                  logInfo("RULE:TEST-ON", results)
                  }
          else if ((receivedCommand)== OFF)        
                  {
                  val String results = executeCommandLine("sudo sh /etc/openhab2/scripts/sendtoCUL.sh is000000000ff0", 5000)
                  logInfo("RULE:TEST-OFF", results)
                  }
     end

You’ll find in the logfile a error message then which gives you further hints.

Hey @Boby,

it dosen’t work via the OS. So there should be any other problem. When I start the comunication via “screen /dev/ttyUSB0 38400” and send some messages everything is fine. At this moment I can also send messages via openhab and see this in the screen. But without starting the screen i don’t get anything communicated to the arduino. So after a reboot from th the Pi, I have the same problem.

Do you have any idea?

Greetings
Dennis

@De_nn_is, have you tried to set the baud rate on OS level?

stty -F /dev/ttyUSB0 38400

…whereas /ttyUSB0 should be the name of your serial port.
If this works for you, just add this line as first command in the bash script & you’re done

Best regards,
Boby

Hello, i found this post here, and wanted to ask if somebody managed to make this working with echo “code” …
i tried with the code that i read 2323029 for example but nothing happens.
it is basic 433 mhz switch