ma-ku / homebridge-elero-stick

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

Motor Specifics #6

Closed AdminMBL closed 2 years ago

AdminMBL commented 2 years ago

Hi there, congrats to your plugin. Two things are not possible for me:

Maybe you have an advice! Thank you in advance!

Markus

ma-ku commented 2 years ago

Mhh. Sounds strange to me. The percentage is derived from the total time to open/close. Since that depends on the size and type of covering being moved, it can be configured per channel. The driver polls the motor state to estimate the position. The polling is never as accurate as desired since there are limitations on the polling frequency and typically it it a bit off the expected position. Only moving to the open or closed position will reset the internal counters. So eventually you need to set the total running time in your config.

apart from that I do know that for some strange reason the initialization sometimes fails. I had to remove the accessory from the Homebridge storage.There is an option somewhere in the admin menu of Homebridge. Maybe this helps.

Other than that I keep planning to rewrite the plug-in as this was my first attempt and I have improved in JS and TS. So hopefully one day I will find the time…

AdminMBL commented 2 years ago

Danke Matthias for your prompt reply. A lot of people are using your plug in, further development is highly appreciated!

KR Markus

AdminMBL commented 2 years ago

Hi, I tried to reinstall the plug in & free the cache. Obviously it did not work out. As long as I define a specific Motor a get the error „could not add accessory for channel x“ I did read the coding elero-stick-platform.ts:

        if (accessory) {
            this.eleroAccessories.set(accessory.uuid, accessory)
        }
        else {
            stick.log.error("Cannot add accessory for channel: %s", channel);
        }
    })    

It seems that the accessory could not be set & I get the else statement. Have you ever experienced that problem? KR Markus

ma-ku commented 2 years ago

I just checked the code but since I am still on vacation, I do not have the necessary equipment with me (who carries a roller shutter along?) to test things. Once I am back, I will try to find the issue. Maybe you can collect infos about the environment in the meanwhile; I would need all versions of you deployment, maybe this is already giving a hint.

Greetings Mathias

AdminMBL commented 2 years ago

Hi Mathias, very nice of you.

Here are my specs: OS: Raspbian GNU/Linux Bullseye (11) Homebridge: v1.5.0 Note.js: v.16.16.0 Hardware: Raspi 4 B 16GB RAM Accessory: Elero Stick 868 MHZ Motors: Elero Shutters, VarioTel2 868 MHZ

-> CONFIG after specification of a Channel/Motor

{ "name": "EleroStick", "port": "/dev/ttyUSB0", "updateInterval": 5000, "movingUpdateInterval": 5000, "motors": [ { "channel": 2, "name": "Test", "type": "Test", "duration": 24000 } ], "platform": "EleroStick" }

-> TERMINAL expression after newstart

[EleroStick] Cannot add accessory for channel: 2

Consequence is, that Channel 2 is not available. If I am not specifying the channel it is added right away (without the possibility to set the opening time).

Kind regards Markus

ma-ku commented 2 years ago

For now, just remove the config for channel 2 and restart. The plug-in will list all channels learned by the stick. Maybe just the index is wrong? It will create an accessory with default settings. You can tweak it later…

AdminMBL commented 2 years ago

Hi, I have it already removed. Then the Channels 0-4 (I have 5 Motors/Rollers) are indexed and ready to use. (without the possibility to set specific ms opening time per roller - of course). KR Markus

AdminMBL commented 2 years ago

EDIT: if I am specifying a non reported Channel (in my case eg 6) nothing happens. It is reported in the Config, but no terminal error message.

ma-ku commented 2 years ago

I found the issue. Actually in your config, you assign a type 'Test' to your motor. The type is limited to 'shades' or 'shutter'.

AdminMBL commented 2 years ago

Yes! You are absolutely right. I tried it once with ‚shutter‘ because I saw it somewhere in the code, but I did not realize that it is case sensitive (‚shutter‘ instead of ‚Shutter‘). THX! Now I am playing around with the closing time, to come to an intermediate position. Thx thx!