ma-ku / homebridge-elero-stick

Homebridge plugin supporting control of Elero Motors
MIT License
11 stars 1 forks source link

Support for Elero Revio 868 #15

Closed murraene closed 9 months ago

murraene commented 1 year ago

Hi Mathias,

have you ever had the chance to test the plug-in with Elero Revio 868? I have 4 of them in use and wanted to figure out - prior to ordering a Transmitter - the chances to get the combination of QNAP, hombridge, Transmitter, Revio working.

Greetings (aus dem Odenwald), Johannes

ma-ku commented 1 year ago

Hi Johannes,

just from the paperwork I would say it should work. Since the transmitter is basically a manual control with USB power, it should be no issue. However, I do not have a Review 868 at hand so I will not be able to test this.

If you order a transmitter, you should have time to return if things are not working.

Greetings (aus dem Herzen Europas - Frankfurt am Main)

Mathias

murraene commented 9 months ago

Hi Matthias,

got my elero Transmitter stick(s) now. I guess I need some more information around getting them connected to the plug in.

Once I plug it in into my QNAP the stick appears as ttyUSB0 under /dev, however when I use ttyUSB0 as port in the plug-in configuration I'm getting the following error messages: [1/2/2024, 12:45:00 PM] [EleroStick] Requesting learned channels from stick [1/2/2024, 12:45:01 PM] Error: Error: No such file or directory, cannot open /dev/ttyUSB0 [1/2/2024, 12:45:01 PM] Got SIGTERM, shutting down Homebridge... [1/2/2024, 12:45:01 PM] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet! at Bridge.Accessory.setupURI (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11) at Server.setServerStatus (/homebridge/node_modules/homebridge/src/server.ts:155:45) at Server.teardown (/homebridge/node_modules/homebridge/src/server.ts:199:10) at signalHandler (/homebridge/node_modules/homebridge/src/cli.ts:93:12) at process.emit (node:events:514:28) at process.emit (/homebridge/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)

Is there anything important I have missed in terms of configuration to get at least the stick correctly detected by the plug-in?

Homebridge running on a QNAP TS251 with Ubuntu Focal Fossa (20.04.5 LTS), Node.js version 20.9.0

Thanks a lot in advance, Johannes

ma-ku commented 9 months ago

Well, I am not familiar with QNAP. Is it a Docker instance or does it run natively on the QNAP?

Typically it is (a) a driver issue, or (b) missing access rights.

Check if you can find anything around this for QNAP and you should be able to get this started.

I will double check how I have set this up on my SYNOLOGY.

Greetings

Mathias

Am 02.01.2024 um 12:49 schrieb murraene @.***>:



Hi Matthias,

got my elero Transmitter stick(s) now. I guess I need some more information around getting them connected to the plug in.

Once I plug it in into my QNAP the stick appears as ttyUSB0 under /dev, however when I use ttyUSB0 as port in the plug-in configuration I'm getting the following error messages: [1/2/2024, 12:45:00 PM] [EleroStick] Requesting learned channels from stick [1/2/2024, 12:45:01 PM] Error: Error: No such file or directory, cannot open /dev/ttyUSB0 [1/2/2024, 12:45:01 PM] Got SIGTERM, shutting down Homebridge... [1/2/2024, 12:45:01 PM] AssertionError [ERR_ASSERTION]: Cannot generate setupURI on an accessory that isn't published yet! at Bridge.Accessory.setupURI (/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:994:11) at Server.setServerStatus (/homebridge/node_modules/homebridge/src/server.ts:155:45) at Server.teardown (/homebridge/node_modules/homebridge/src/server.ts:199:10) at signalHandler (/homebridge/node_modules/homebridge/src/cli.ts:93:12) at process.emit (node:events:514:28) at process.emit (/homebridge/node_modules/homebridge/node_modules/source-map-support/source-map-support.js:516:21)

Is there anything important I have missed in terms of configuration to get at least the stick correctly detected by the plug-in?

Thanks a lot in advance, Johannes

— Reply to this email directly, view it on GitHubhttps://github.com/ma-ku/homebridge-elero-stick/issues/15#issuecomment-1873930107, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAD64SUI7ZSHAA4L43AXK3TYMPX5XAVCNFSM6AAAAAA5YX5TCSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTHEZTAMJQG4. You are receiving this because you commented.Message ID: @.***>

murraene commented 9 months ago

Well, I am not familiar with QNAP. Is it a Docker instance or does it run natively on the QNAP? Typically it is (a) a driver issue, or (b) missing access rights. Check if you can find anything around this for QNAP and you should be able to get this started. I will double check how I have set this up on my SYNOLOGY.

It's running as a Docker Instance and thanks for checking how you did set this up on your Synology

ma-ku commented 9 months ago

I am running the following script before the container is started:

#!/bin/sh

#
# Docker Homebridge Custom Startup Script - oznu/homebridge
#
# This script can be used to customise the environment and will be executed as
# the root user each time the container starts.
#
# If using this to install plugins DO NOT use the global flag (-g).
#
# Example installing homebridge plugin:
#
# npm install homebridge-hue
#
# Example installing packages using default image (Alpine Linux):
#
# apk add --no-cache ffmpeg ffmpeg-libs libpcap-dev
#
# If you're running a debian based version of this container please use apt-get to install packages.
#

apk add --no-cache ffmpeg ffmpeg-libs libpcap-dev chromium

apk add --no-cache make gcc g++ python linux-headers udev
apk add --no-cache bash busybox

sudo insmod /lib/modules/usbserial.ko
sudo insmod /lib/modules/ftdi_sio.ko

chmod 777 /dev/ttyUSB0
chmod 777 /dev/ttyACM0

and in the settings it is then referenced as /dev/ttyUSB0 so probably the /dev/ttyACM0 is not needed anymore.

image

But since you already can see /dev/ttyUSB0 I would assume that drivers are not a problem. So eventually it is more an issue with access rights chmod 777 /dev/ttyUSB0. Can you open a terminal in the container so that you can inspect the access rights and if the port is listed in the container? If you have the same image as me (oznu/homebridge), you can open the terminal from the web interface.

Greetings

Mathias

murraene commented 9 months ago

Hi Mathias,

I connected via ssh and tried to simply set access to 777 - unfortunately this did not solve the problem.

Interestingly, when checking dev in the container terminal (also using oznu/homebridge) I only see "tty" but no "ttyUSB0" anymore. Not sure if this is how it is expected. Is it necessary to add /dev/ttyUSB0 to the environment configuration for the Docker container?

Maybe a general question - does the stick need to be trained on the different motors upfront? Asking as the log states "Requesting learned channels from stick".

ma-ku commented 9 months ago

You need to pass the devices into the container. SYNOLOGY offers the privileged mode in the UI-Settings. Check the following link for details on device sharing: https://stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device

Regarding the training of the stick; it‘s basically a manual remote with clumsy design. You can train it with each motor you want. You can have standard remotes and the USB-Stick side by side if you want. The plugin then gives these channels a name and makes them accessible via HomeBridge and HomeKit.

murraene commented 9 months ago

Hi Mathias,

the issue was that my Docker was indeed not running in privileged mode and therefore the TTY devices were not passed from the host into the Docker. This is working now. Thanks a lot for that hint!

The plugin/stick now detected 4 channels (0-3). All appear as "closed" although the are fully open. Changing the status from 0% = fully closed to e.g. 50% "half open" nothing happens. Same for all channels. In addition there are 2 more Elero motors that are not yet detected.

Is there anything I need to configure per channel so that the command is passed forward to the respective motor?

Thanks a lot!

ma-ku commented 9 months ago

Weil, eventually you need to negate the direction so that open turns closed and vice versa. The meaning of these depend on how the motor is learned to the remote. I was struggling a lot with that behavior. Give it a try and let me know what happens.

ma-ku commented 9 months ago

Can you share your configuration? There is noting in it that would tamper the safety of your house so no worries. I am wondering if we could arrange a chat/call to nail the problem?

murraene commented 9 months ago

Hi Mathias,

this is my configuration for the Elero plug-in:

"name": "EleroStick", "port": "/dev/ttyUSB0", "updateInterval": 5000, "movingUpdateInterval": 1500, "sendInterval": 250, "motors": [ { "channel": 0, "name": "1", "type": "shades", "reverse": true, "duration": 5000, "startDelay": 0, "stopButton": false, "intermediatePositionButton": false, "ventilationPositionButton": false }, { "channel": 1, "name": "2", "type": "shades", "reverse": true, "duration": 5000, "startDelay": 0, "stopButton": false, "intermediatePositionButton": false, "ventilationPositionButton": false }, { "channel": 2, "name": "3", "type": "shades", "reverse": true, "duration": 5000, "startDelay": 0, "stopButton": false, "intermediatePositionButton": false, "ventilationPositionButton": false }, { "channel": 3, "name": "4", "type": "shades", "reverse": true, "duration": 5000, "startDelay": 0, "stopButton": false, "intermediatePositionButton": false, "ventilationPositionButton": false } ], "platform": "EleroStick" }

As for the general set-up here at my place: 4 Elero Revio 868 (https://www.elero.de/de/produkte/steuerungen/revio-868) 2 Warema blinds (https://www.warema.com/de-de/jalousie/schraeg-aussenjalousien-e-80-af-sr/)

All 6 working fine with my Elero TempoTel 2 remote

It would be great if we could have a quick chat/call to narrow down the problem further.

ma-ku commented 9 months ago

Looks good to me. Can you control the shades from the stick? As I said, it works basically like a multichannel remote.

murraene commented 9 months ago

Currently nothing happens from the stick as I think I've made a completely stupid mistake/assumption here.

I need to train the stick upfront like I did it for my TempoTel 2 before it works as expected, right? How else should the stick or the plug-in know which shade is linked to which channel...

ma-ku commented 9 months ago

I have picked the section from the manual where another remote is added to a given motor:

image image

You can plug the usb stick into a battery or an ac adapter and program it without being attached to the computer. Once you can control the shaded with the stick manually, you can also use the computer...

murraene commented 9 months ago

Thank you very much and sorry to have bothered you just because of an oversight on my end. I will do this tomorrow as my kids are already asleep. I'll give an update tomorrow on my progress with training the stick and using it with the plugin. Have a nice evening...

murraene commented 9 months ago

It now works as expected! Thanks so much for your continued support.

ma-ku commented 9 months ago

Any time. You are welcome. Glad it's working now.

ma-ku commented 9 months ago

Nothing to do with the code. Will close this.