Fs20 & CUL with openhab2

Hey there,

I can’t find any information about fs20 devices and openhab 2. The install process works, but the binding doesn’t appear in “Config -> Bindings” in the ui.
How do I configure the cul stick and my fs20 devices in oh2?

Thanks,
Stefan

Hi Stefan,
since it’s a OH1 Addon, you have to configure it in the OH1-Style, with config files:

  • in the config/services directory, add a file “fs20.cfg” and put the device config w/o the fs20: prefix, e.g.

    device=serial:/dev/ttyWhateverYouHave

  • in config/items , create a file e.g. fs20.items, and describe your items using OH1 syntax; mine worked unchanged

  • in conf/sitemaps, add your Items to your sitemap

Hello

I’m new to openHab and pretty confused right now. Previously I was running FHEM because of my FS20 devices. Now I would like to try the switch to openHab2. I’m running openHab2 on a Debian Linux (14.1-jessie).

  • I installed the FS20 Binding (binding-fs20 - 1.9.0.b4) using the Paper-UI GUI.

  • Checking my usb CUL modul with screen /dev/ttyACM0 and V returns V 1.61 CUL868. I guess that should be a good sign? (latest version is 1.66 as I have seen, will this cause problems?)

  • I created a config in /etc/openhab2/services/fs20.cfg as you said with this content:

fs20:device=serial:/dev/ttyACM0
  • Added an Item here: /etc/openhab2/items/fs20.items with this content:
Switch PowerSocket    "PowerOne"    {fs20="C85205"}
  • Added a sitemap here: /etc/openhab2/sitemaps/fs20.sitemap with:
    sitemap fs20 label="FS20 Test"
    {
        Frame {
            Switch item=PowerSocket label="Power1" mappings=[off="off", on="on"]
        }
    }
  • If I enter http://192.168.11.37:8080/basicui/app?sitemap=fs20 to view the sitemap I can see my switch. (suprisingly it has “On” & “Off” buttons rather than a toggle slider. Guess thats not a good sign?)

  • If I check the log using the openhab telnet client log:tail command I get:
    20:16:33.694 [WARN ] [thome.io.rest.core.item.ItemResource] - Received HTTP POST request at 'items/PowerSocket' with an invalid status value 'on'.

I did my best to find the right setup but now it gets really frustrating. Could someone guide me in the right direction?

Thanks, Andi

ok it works for me now!
Everything below is my noob linux knowledge, so be careful :wink:

Check if your usb device is correct mounted and to which address:

dmesg

[    4.661684] pcnet32 0000:02:01.0 eth0: link up
[  199.580235] usb 2-1: USB disconnect, device number 2
[  216.737266] usb 2-1: new full-speed USB device number 4 using uhci_hcd
[  217.349267] usb 2-1: New USB device found, idVendor=03eb, idProduct=204b
[  217.349273] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  217.349276] usb 2-1: Product: CUL868
[  217.349279] usb 2-1: Manufacturer: busware.de
[  217.353447] cdc_acm 2-1:1.0: ttyACM1: USB ACM device

My CUL was at some point mounted to ttyACM1 rather than ttyACM0


Than I flashed my CUL from busware to the latest version (probably not necessary though):

apt-get install dfu-programmer
apt-get install build-essential

Download CUL firmware and extract.

cd culfw-1.66/Devices/CUL
sudo make usbprogram_v3

That will be returned:

dfu-programmer atmega32u4 erase || true
dfu-programmer atmega32u4 flash CUL_V3.hex
Validating...
18582 bytes used (64.81%)
dfu-programmer atmega32u4 start

check version:

screen /dev/ttyACM0
V

If you have a FS20 remote to send commands you should be able to see them while running screen.


I changed the fs20.cfg accordingly:

fs20:device=serial:/dev/ttyACM1

And deleted the “mapping” inside the sitemap:

sitemap fs20 label="FS20 Test"
{
    Frame {
        Switch item=PowerSocket label="Power1"
    }
}

You can check if the usb port is in use by another process:

apt-get install lsof
lsof /dev/ttyACM1

root@core /home/share_with_windows# lsof /dev/ttyACM1
COMMAND  PID    USER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
java    3806 openhab  155u   CHR  166,1      0t0 13350 /dev/ttyACM1

For me the screen command was blocking the device from beeing used in openhab.

if so, terminate it with kill and the PID ID from above


You can debug the fs20 binding in the telnet client using:

log:set DEBUG org.openhab.binding.fs20
log:tail
1 Like

Hey There, I’m having the problem, that my CUL 868 which has previoulsy worked with FHEM won’t detect or send any FS20 signals with my Debian Stretch + Openhab2 RPI3.

  • I have succesfully flashed the 1.67 culfw.
  • dmesg shows the CUL
  • fs20 Binding installed in Paper UI(not seeing it anywhere except when I search for new Bindings in the List though)
  • Sitemap and Item with Controls are Visible in Basic UI. Clicking one of the Actions doesn’t have any effect at all.

events.log

[ 3081.429334] usb 1-1.2: new full-speed USB device number 6 using dwc_otg
[ 3081.577620] usb 1-1.2: New USB device found, idVendor=03eb, idProduct=204b
[ 3081.577633] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3081.577641] usb 1-1.2: Product: CUL868
[ 3081.577649] usb 1-1.2: Manufacturer: busware.de
[ 3081.578798] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
  • Screen /dev/ttyACM0 and V shows the Correct Name (V 1.67 CUL868
    ) and Version,
  • Screen /dev/ttyACM0 shows no incoming Signals when I start pushing Buttons on FS20 remotes whatsoever.

Since it doesn’ t recognize incoming signals AND doesnt send the proper Signals to actors(tested with rollershutter according to previous posts), think it doesn’t have anything to do with my openhab configuration and I have a more general problem.

Would anybody here be so kind to give me any kind of hint, what to look for. Also I’m kind of a Debian noob, so please don’t be to hard on me. :slight_smile: Thank you, every comment is well appreciated!!! I’m really out of Ideas about what to do next.

I think the question is: Why isn’t my CUL doing anything? Any Ideas for what else I can try/check/do?

2017-11-25 20:03:47.825 [ExtensionEvent            ] - Extension 'package-standard' has been installed.
2017-11-25 20:04:05.650 [ExtensionEvent            ] - Extension 'ui-basic' has been installed.
2017-11-25 20:04:05.653 [ExtensionEvent            ] - Extension 'ui-habpanel' has been installed.
2017-11-25 20:04:05.656 [ExtensionEvent            ] - Extension 'ui-paper' has been installed.
2017-11-25 20:16:31.416 [ExtensionEvent            ] - Extension 'binding-fs201' has been installed.
2017-11-25 20:16:47.080 [ExtensionEvent            ] - Extension 'binding-intertechno1' has been installed.
2017-11-26 10:02:35.332 [ItemCommandEvent          ] - Item 'ROL_SZ_100' received command DOWN
2017-11-26 10:02:35.397 [ItemStateChangedEvent     ] - ROL_SZ_100 changed from NULL to 100

fs20.cfg

fs20:device=serial:/dev/ttyACM0
fs20:baudrate=38400
fs20:parity=NONE

fs20.items

Rollershutter ROL_SZ_100 "Rolladen Schlafzimmer" {fs20="456721"}

fs20.sitemap

sitemap fs20 label="My first sitemap"
{
    Switch item=ROL_SZ_100 label="Rolladen Schlafzimmer"
}


changed my fs20.cfg and removed the “fs20:” which is, as i read somewhere, not necessary anymore. Doen’t make a difference however. Any help is greatly appreciated!

Hi @Simsal , thanks for you feedback. Do you have any reference to HTML Commands into FHEM? Are you running FHEM and Openhab on the same PI?

hi @deebeo,

I struggled a long time myself with fs20 devices over openhab. Users in this forum report that it is working with older, pre 2.x, versions of openhab but afterwards it seems to be broken.

In the end, i changed the binding of fs20 back to fhem and now i am controlling them via URL commandos out of openhab. Not the cleanest of things, but still… it works :wink:

AFAIK there is no real reference to the commandos.

If you control them via fhem webpage you can trun on developer tools in chrome (same in firefox, …) to see which commandos fhem uses internally.

I am running fhem and openhab on the same pi:

Example commando:

sendHttpPostRequest("http://openhabianpi:8083/fhem?cmd=set%20FHT_585d%20desired-temp%2022.0")

The Problem was that you use the wrong status. I had the same problem, because i following your steps.

change your sitemap to:

OFF and ON has to be in upper letters

Wouldn‘t it makae to build a OH2 FS20 binding?

That would bei great, but i can’t do that.

I need to complete my work on another binding (Telekom Media Receiver / MagentaTV) before looking into this. FS20 is still open on my list (I use it for the garden lights, so not super important, but nice to have).

Are you familiar with the 1.x code? or FS20 technically in general? I did a quick look to the code and it doesn’t look too complex, but details could become a devil :slight_smile:

Not really, but i will test your code if you want.