Integration Schellenberg

Hey again,
do you have any other idea why it might not work? It can’t be the model of the roller shutter motor, isn’t it the latest model with radio / smart home functionality? Thanks a lot for your help.

HI there,

your issue is the MQTT connectivity.

  • The Smart Friends bridge does communicate with the Box. That’s OK. :ok_hand:
  • The Smart Friends bridge does NOT receive any messages from the MQTT broker. That’s your problem.

Did you cross-checked the MQTT config? Basically there are 3 major steps as specified in the MQTT mosquitto add-on documentation:

  1. installation of the MQTT Add-on
  2. create MQTT users
  3. add MQTT integration: configuration > integration > Add integration “MQTT”

The MQTT integration page is useful and if you don’t have any client, you can use it instead.
Go to Integration page and open MQTT > Configure.

There you’ll be able to simulate your cover actions, try to open cover from there:

  • topic = schellenberg/device/value/update/***** <==== device for open/close
  • payload = 0 or 1 or 2

At the same time you can listen to all bridge related topics: schellenberg/device/value/#

If you still not able to get it working, send me a message in private… I’ll help you further if needed.

Great, that helped. All 9 shutters work after I deleted the MQTT broker and reinstalled it. As a URL I did not enter myhassio.local but the IP address of the broker. Now it works perfectly.
Many thanks for your help!!!

1 Like

Hi, first - thanks for the Bridge!
It worked like a charm, but out of a sudden I cant receive the device list anymore.

Sometimes I receive a 502: Bad Gateway
and sometimes I receive an empty list:

Smart Friends Bridge

Device list

Show entries

Search:

deviceID deviceName deviceDesignation masterDeviceID masterDeviceName
No data available in table

Showing 0 to 0 of 0 entries

MQTT Integration receives updates with "schellenberg/device/value/#
and also my Sensors are receiving informations.

I found this in the Bridge-log:

2021-02-14T19:33:05.309Z [SmartSocket] Send and Recieve Command: {“command”:“helo”,“username”:“hassio”}
2021-02-14T19:33:05.328Z [SmartSocket] Recieved Data: { “response” : { “salt” : “rSGp4TmvGUc3qoK6q7UNx6YYXFo=”, “sessionSalt” : “s8XkE/RqInbSJ5XlBdWhU2/zT1x=” }, “responseCode” : 1, “responseMessage” : “success” }
node:internal/process/promises:227
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason “timeout”.] {
code: ‘ERR_UNHANDLED_REJECTION’
}
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts…
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Login with the “hassio” user works.

before that I received the “normal” keepalive logs.

In the Supervisor Log there is:
21-02-14 20:06:30 ERROR (MainThread) [supervisor.api.ingress] Ingress error: Cannot connect to host 172.30.33.2:80 ssl:default [Connect call failed (‘172.30.33.2’, 80)]
21-02-14 20:02:27 WARNING (MainThread) [supervisor.misc.tasks] Watchdog found a problem with 28ecc432_smartfriendsbridge!
21-02-14 20:02:27 INFO (SyncWorker_0) [supervisor.docker.interface] Cleaning addon_28ecc432_smartfriendsbridge application
21-02-14 20:02:28 INFO (SyncWorker_0) [supervisor.docker.addon] Starting Docker add-on airthusiast/smart-friends-bridge-amd64 with version 1.1.2

Strange:
If I stop the Bridge, I still receive Values from the MQTT Integration.
If I stop the MQTT Integration, then I receive the Device list without issues.

The only thing what changed during the day but I don´t know if its related to that:
There was an update of Integrations or Supervisor. - I cant remember…

Thanks
Connor

Hi @Connor2010 and welcome !

Yes there has been a supervisor update lately.
But the behavior that you describing is somehow strange.

Take note that the values sent from Bridge to MQTT broker are retained.
So even if Bridge is stopped, and you restart Hassio completely or just the MQTT add-on, the MQTT broker will have all values retained, and send them again to clients reconnecting (any MQTT client subscribed to the topics). That’s perhaps what you observed.

or… other side-note:
I experienced some issues with add-ons watchdog in the past. When stopping add-on manually (no crash), the watchdog restarted it automatically. So to really stop it, I had to disable watchdog… But that issue seems to be fixed, as I cannot reproduce it anymore.

In your log I see a timeout exception. There seems to be a connectivity issue with the box.

What I recommend you to do, stop everything: restart Hassio and add-ons, and check again. And at the same time use the official Schellenberg or Smart Friends App and try connecting directly to the Box. Important: do not connect with the same user on your app, it will disconnect user used in add-on. A single user can only be connected once at the same time.
If the official app has issues as well, then it’s a network related or box-related issue.

If you check previous comments, @MarcelNullVier also had connection issues to the box, and unfortunately the issues where related to the box and the underlying storage.

Let’s hope that it’s not your case.

Hi again,

ok did not think about the retained values, makes sense.

I disabled watchdog on MQTT Broker and Bridge, stopped them.
Then I stopped the Server and rebooted the Machine itself.

There it was like expected, no MQTT Broker and Bridge running.
I started the MQTT Broker and it behaves normally.
I started the Bridge and it stopped from itself directly with the
[s6-finish] sending all processes the TERM signal.
So the strange behaviour above was because the watchdog restarts the Bridge over and over again.
But when I start the Bridge first without the MQTT Broker, the Bridge runs with the normal “keepalive” log.
When I then start the MQTT Broker, the Bridge immediately stops.

I use different users for the App and the Bridge.
No issue with the App.

Any ideas?

Update: I played a little bit and found out that if I enter a wrong user
in the Bridge Config:
mqtt:
url: ‘mqtt://ip’
username: wronguser
password: wrongpw

Then the Bridge dont stops.

If the correct user is entered in the Bridge config:
then the MQTT Broker log is:
1613432521: New client connected from 172.30.32.1 as mqttjs_4327ff4c (p2, c1, k60, u’CORRECTMQTTUSER’).
1613432526: Socket error on client mqttjs_4327ff4c, disconnecting.

If the wrong user is entered in the Bridge config:
then the MQTT Broker log is:
1613433447: New connection from 172.30.32.1 on port 1883.
[ERROR] Auth error with WRONGUSER
1613433447: Socket error on client , disconnecting.

and repeating…

What did I do wrong? - from the documentation I expected to:

  • create a mqtt user in hassio
  • add the mqtt addon
  • integrate mqtt, reconfigure and add the user there
  • add the Bridge and enter the mqtt ip and user there.

:nerd_face:

Ok, after enough time spent in trying user/pw and some settings I solved the issue:
Removed Integration, uninstalled MQTT, restarted, installed everything again with exactly the same settings…
And it runs…

1 Like

Thank you for the great addon. Since today I am getting an error: CERT_HAS_EXPIRED.
Any tip?

Hello, i have installed the Schellenberg Bridge to connect a smart friends box as per instruction. I have added all shutters(Premium Rohrmotor and Rollodrives) Closing and Stop works perfectly, but i cant open the shutters the up button is grey and i can’t find a way to activate the up button. Its grey for all shutters and also no change after i close it.
Does anyone has an idea how to solve this issue?
Thanks in advance
Tobias

I know this topic has been inactive for a while but in case someone is also trying to do this: I got it to work using the Schellenberg wireless stick and the Schellenberg belt winder running home assistant on a Raspberry. This solution does not require a smart friends box or anything else.

My solution is based on the reverse engineering of the Schellenberg wirless stick which was done by someone else in this repository.

I will try to explain as good as I can how I set the belt winder up but if you have any questions feel free to ask. Also I am quite new to home assistant so my soultion may not be perfect - if you have any suggestions on how to improve it please let me know as I am always happy to learn :smiley:

Find the correct usb port
Plug the wireless stick into the Raspberry Pi and connect to the Raspberry via SSH. Then run dmesg which should deliver an output like in the screenshot below (maybe you need to scroll up a bit to find the correct lines):

The yellow highlighted part is the USB port we are looking for (if it says something different on your system replace the value in all future commands).

Pair the Shutters
The pairing of the shutters requires that the shutters are already paired (and working!) with a remote (I used the one with 5 channels).

  1. Select the channel on the remote that controlls the device that shall be paired
  2. Press the button on the battery compartment of the remote control to put it into programming mode
  3. Press the middle button of the remote control
  4. Send the “Pair” command to the wireless stick using echo "ss119400000" > /dev/ttyACM1 (11 is the new device identifier - change this for every device you are pairing)
  5. Again press the button in the battery compartment of the remote control

You can test if the pairing worked by using echo "ss119010000" > /dev/ttyACM1 to open the sutter and echo "ss119020000" > /dev/ttyACM1 to close the shutter.

Create a bash script
I created a bash script to send commands to my shutters at config/bash_scripts/control_shutter.sh:

echo "init" > /dev/ttyACM1
sleep 1
echo "ss"$1"9"$2"0000" > /dev/ttyACM1
sleep 1

The first command can be anything - I just found out that for some reason only every second command is executed (if someone knows why and how to avoid it let me know). The 1 second delay is needed because the wireless stick cannot handle parallel requests so I need to wait for the a command to complete before the next one can be issued.

I then made the bash script available in home assistant by adding

shell_command:
  control_shutter: bash /config/bash_scripts/control_shutter.sh {{ device_id }} {{ command }}

to my configuration.yaml

Create an input boolean
Create an input boolean which will represent the state of the shutter in home assistant (mine is called input_boolean.bedroom_shutter_is_open). The shutters do not report back anything to the wireless stick so the state we will be optimistically assumed and might get out of sync with the actual position of the shutter if a command is not received correctly or the position of the shutter is changed manually. In this case the state in HA must be changed manually to match the actual position.

Create a script
Add the following home assistant scripts to your configuration.yaml:

script:
  open_bedroom_shutter:
    alias: Open bedroom shutter
    sequence:
    - service: script.control_shutter
      data:
        device_id: '11'
        command: '01'
    - service: input_boolean.turn_on
      data: {}
      target:
        entity_id: input_boolean.bedroom_shutter_is_open
    mode: queued
    icon: mdi:window-shutter-open
    max: 10
  close_bedroom_shutter:
    alias: Close bedroom shutter
    sequence:
    - service: script.control_shutter
      data:
        device_id: '11'
        command: '02'
    - service: input_boolean.turn_off
      data: {}
      target:
        entity_id: input_boolean.bedroom_shutter_is_open
    mode: queued
    icon: mdi:window-shutter
    max: 10
  control_shutter:
    alias: Control shutters
    sequence:
    - service: shell_command.control_shutter
      data:
        device_id: '{{ device_id }}'
        command: '{{ command }}'
    mode: queued
    icon: mdi:window-shutter-alert
  max: 20

I use the single script control_shutter for all commands I am sending to be able to queue all requests to the wireless stick as it cannot hanlde them in parallel.

Add an entity
The last thing you need to do is create a cover entity from a template by adding:

cover:
  - platform: template
    covers:
      bedroom_shutter:
        unique_id: "bedroom_shutter"
        device_class: shutter
        friendly_name: "Bedroom shutter"
        value_template: "{{ states('input_boolean.bedroom_shutter_is_open') == 'on' }}"
        open_cover:
          service: script.open_bedroom_shutter
        close_cover:
          service: script.close_bedroom_shutter

to your configuration.yaml

You should now be able to contoll you shutter through HA.

This solution is propably not 100% reliable but it works fine for me so far. I wanted to share it in case someone else does not want to buy another box and have it standing around :see_no_evil:. There surely are ways to improve this setup so if you have any recommendations I am happy to learn more about them.

5 Likes

Hello Community,
I’m a absolute newbie at HA. Like the others in this forum I would like to automate my shutters from Schellenberg. For information: I use a Smartfriendsbox. I can use the shutters by Smartfrioends app.

I also installed the add-ons “Schellenberg” and “Smart Friends Bridge”.

My config at “Schellenberg”-app:

host: 192.168.178.181
port: 4300
username: Admin
password: not written at this forum :-)
enableDebug: true
cSymbol: D19033
cSymbolAddon: i
shcVersion: 2.22.3
shApiVersion: '2.20'

My config at “Smart Friends Bridge”:

host: 192.168.178.181
port: 4300
username: Admin
password: not written at this forum :-)

enableDebug: true
cSymbol: D19033
cSymbolAddon: i
shcVersion: 2.22.3
shApiVersion: '2.20'
url: mqtt://mqqt.example.com
username: admin
password: not written at this forum :-)

The information for the configs I got from the SmartFriends-App of my Handy as described.

Starting the Web User Interface of the “Smart Friends Bridge” at HA I got the following:

--- START ---
|deviceID|deviceName|deviceDesignation|masterDeviceID|masterDeviceName|
| --- | --- | --- | --- | --- |
|558|Morgendämmerung|AstrofunktionStr|1296|Astrofunktion|
|796|Serverstatus|Serverstatus|13750|Smart Friends Box|
|1077|Motor|Rollodrive PREMIUM|9331|Rollo Links|
|1563|Position|Position|10263|Rollo Felix|
|5494|Motor|Rollodrive PREMIUM|10691|Rollodrive PREMIUM|
|6658|Status|${SchellenbergRssi}|10691|Rollodrive PREMIUM|
|7195|smartfriendsbox|pushNotification|19001|Push-Nachricht|
|8358|Position|Position|11572|Rollo Küche|
|9646|Abenddämmerung|AstrofunktionStr|1296|Astrofunktion|
|9668|Position|Position|4049|Rollodrive PREMIUM|
|9864|Status|${SchellenbergRssi}|11572|Rollo Küche|
|9985|Push-Nachricht|pushNotificationChain|0||
|10014|Letzter Sonnenstand|Astrofunktion|1296|Astrofunktion|
|10620|Status|${SchellenbergRssi}|8751|Rollodrive PREMIUM|
|11075|Motor|Rollodrive PREMIUM|11572|Rollo Küche|
|11401|Status|${SchellenbergRssi}|4049|Rollodrive PREMIUM|
|12862|Position|Position|9331|Rollo Links|
|13665|Mittag|AstrofunktionStr|1296|Astrofunktion|
|13708|Status|${SchellenbergRssi}|9331|Rollo Links|
|14027|Sonnenuntergang|AstrofunktionStr|1296|Astrofunktion|
|14082|Position|Position|8751|Rollodrive PREMIUM|
|16955|Motor|Rollodrive PREMIUM|8751|Rollodrive PREMIUM|
|17300|Status|${SchellenbergRssi}|10263|Rollo Felix|
|17426|Sonnenaufgang|AstrofunktionStr|1296|Astrofunktion|
|17842|Motor|Rollodrive PREMIUM|10263|Rollo Felix|
|18443|Motor|Rollodrive PREMIUM|4049|Rollodrive PREMIUM|
|18633|Position|Position|10691|Rollodrive PREMIUM|
--- END ---

For example I try to integrate the shutter “Rollo Felix”.
(deviceID: 17842, masterDeviceID: 10263 for deviceName “Motor”

So I extend my configuration.yaml file to the following:

--- START ---
# Loads default set of integrations. Do not remove.
default_config:

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml


shell_command:
    roller_shutter_up:        "curl http://127.0.0.1:8181/rollingshutter/v1/open/{{ device_id }}"
    roller_shutter_down:      "curl http://127.0.0.1:8181/rollingshutter/v1/close/{{ device_id }}"
    roller_shutter_position:  "curl http://127.0.0.1:8181/rollingshutter/v1/setposition/{{ device_id }}/{{ position }}"
    roller_shutter_stop:      "curl http://127.0.0.1:8181/rollingshutter/v1/stop/{{ device_id }}"

sensor:
  - platform: command_line
    name: my_cover_1_position
    command: "curl http://127.0.0.1:8181/rollingshutter/v1/getposition/1563"
    unit_of_measurement: "%"
    scan_interval: 30

cover:
  - platform: template
    covers:
      my_cover_1:
        friendly_name: "My Roller Shutter"
        device_class: shutter
        position_template: "{{ states('sensor.my_cover_1_position') }}"
        open_cover:
          service: shell_command.roller_shutter_up
          data: 
            device_id: 17842
        close_cover:
          service: shell_command.roller_shutter_down
          data: 
            device_id: 17842
        stop_cover:
          service: shell_command.roller_shutter_stop
          data: 
            device_id: 17842
        set_cover_position:
          service: shell_command.roller_shutter_position
          data_template: 
            device_id: 1563
            position: "{{ position }}"
--- END ---

I tried to test it with a node-red. I connected a “injection” to a “call service”.
Call service has the following parameters:
Server: Home Assistant
Domain: shell_command
Service: roller_shutter_down

When I activate the injection, the indication field to the “shell”-node becomes green and it’s written “shell_command_roller_shutter_up_called at Aug. 1, 16:10”

But unfortunately the shutter doesn’t want to move. I tried it at my other shutters and I also tried it with shutter_up. Nothing moves.
I also changed the v1 to v2 at command: “curl http://127.0.0.1:8181/rollingshutter/v1/getposition/1563
but again: nothing moves :frowning:

In the log of HA I see the following error about it:

--- START ---
Logger: homeassistant.components.shell_command
Source: /usr/src/homeassistant/homeassistant/components/shell_command/__init__.py:115
Integration: Shell Command ([documentation](https://www.home-assistant.io/integrations/shell_command), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+shell_command%22))
First occurred: 16:10:42 (2 occurrences)
Last logged: 16:11:23

* Error running command: `curl http://127.0.0.1:8181/rollingshutter/v1/open/{{ device_id }}`, return code: 6
* Error running command: `curl http://127.0.0.1:8181/rollingshutter/v1/close/{{ device_id }}`, return code: 6
NoneType: None
--- END ---

I’m sure I’m not far away to the solution. But I can’t see what I have done wrong or why the URL is wrong. It’s the same like in the example…

Can anyone please help???

Kind regards,
Andy (from Germany)

Hallo Andy,

weil Du Deine Verbindung über die Smartfriends-Box machst, ist die Schellenberg-App nicht notwendig. Du solltest sie deinstallieren.
Außerdem gibt es inzwischen mehrere Smartfriends-Apps. Aus welchem Repository verwendest Du sie? Ich verwende https://github.com/airthusiast/hassio-addons. Es gibt z.B. auch noch https://github.com/gimparm/hassio-addons.
Wie ich sehe, hast Du den MQTT-Server nicht konfiguriert (url: mqtt://mqqt.example…com). Weil ich den Mosquitto broker als HA-Addon nutze, habe ich hier die Andresse meines HA eingetragen (mit Protokoll mqtt://).

VG
Jacky

Hallo Jacky,

herzlichen Dank für Deine Antwort. Ich denke, ich habe nur (!) die “Smartfriends-Bridge” (https://github.com/airthusiast/smart-friends-bridge) und die Schellenberg-App installiert.
Die Schellenberg-App werde ich wie Du empfiehlst entfernen.

Mein MQTT-Server ist noch komplett unangetastet. Wie schon gesagt, bin ich bzgl. Hausautomation kompletter Anfänger.

Ich werde mein Glück mal mit dem von Dir erwähnten Alternative https://github.com/gimparm/hassio-addons testen. Vielleicht habe ich da mehr Erfolg. Ich werde auch jeden Fall meine Ergebnisse schildern!!!

Liebe Grüße,
Andy

i cant get the shell command / bash script to work.
I can controll the shutter via echo "ss119020000" > /dev/ttyACM1
but not via the script.
I am using hass.io on raspberry 4, any tips?

Hi!

I’m not 100% sure anymore but I think that a plugin is required to be able to execute bash scripts at all (maybe I forgot that in the instructions above). Have you installed one of them? And have you tried if your bash scripts gets executed at all?

I think I used this plugin Shell Command - Home Assistant

Br

1 Like

So after some tests iam sucessfully using now the following (in configuration.yaml):

cover:
  - platform: command_line
#    unique_id: rolladen_kueche_beide
    covers:
      rolladen_kueche_beide:
        command_open: "echo 'ss119010000' > /dev/ttyACM0"
        command_close: "echo 'ss119020000' > /dev/ttyACM0"
        command_stop: "echo 'ss119000000' > /dev/ttyACM0"

This generates an entity, which is controlable by homeassistant. i use “glances” in lovelace, there you get arrows for up and down and a stop button…

So i am not using a bash script, a homeassistant script, the input boolean or the shell_command.

lets see how far i get with that.

1 Like

Hi!

After upgrading Home Assistant to 12.5, the blinds are no longer displayed.
The message in the logs looks like this:

Logger: homeassistant.components.cover
Source: helpers/entity_platform.py:193
Integration: coverage (documentation, issues)
First occurred: 22:04:39 (17 occurrences)
Last logged: 22:04:39

The mqtt platform for the cover integration does not support platform setup. Please remove it from your config.

my current config:

cover:

  • platform: mqtt
    name: AZ Jalousie
    device_class: shutter
    retain: false
    qos: 0

    Payloads

    payload_open: “1”
    payload_close: “2”
    payload_stop: “0”

    State

    command_topic: “schellenberg/device/value/update/7408”

    Position

    position_topic: “schellenberg/device/value/431”
    set_position_topic: “schellenberg/device/value/update/431”
    position_open: 0
    position_closed: 100

Any ideas?

Thanks!

New configuration format:

mqtt:
  cover:
    - name: AZ Jalousie
      device_class: shutter
      retain: false
      qos: 0
      payload_open: “1”
      payload_close: “2”
      payload_stop: “0”
      command_topic: “schellenberg/device/value/update/7408”
      position_topic: “schellenberg/device/value/431”
      set_position_topic: “schellenberg/device/value/update/431”
      position_open: 0
      position_closed: 100

Thanks - it works!

Habe das Addon auch installiert für meine Rollos, erst über die Rest API und dann später über MQTT. Habe Rollo Motore ohne Rückmeldung so das ich auch die Integration „Cover rf time based“ zusätzlich installiert habe. Jetzt kann ich mit der Custom Hass Shutter Card die Rollos fahren wie ich will auch auf verschiedene Pos. Selbst Alexa kommt damit klar.

1 Like