madchicken / homebridge-comelit-hub

Homebridge Comelit HUB platform plugin
Apache License 2.0
16 stars 3 forks source link

Module 20004606 ( blinds ) #34

Closed tomasell closed 3 years ago

tomasell commented 3 years ago

Hi @madchicken , next days i'll install the new module 20004606 ( known as MODULO TAPPARELLE 2IN/2OUT - ART. 20004606 ) in my home. I'd like to ask two questions:

Thanks

Datasheet extract :

TAPPARELLA: questa opzione permette di comandare una tapparella o un’automazione con doppia uscita (apertura, chiusura e posizione percentuale). Impostando l’uscita 1 come "Tapparella" automaticamente viene impostata anche l'uscita 2 come "Tapparella" in quanto in questa modalità le uscite funzionano in modo abbinato. Inoltre con questa funzione si crea un interblocco che evita l’attivazione contemporanea delle uscite di salita e discesa. Se si lascia un tempo pari a 0 le uscite verranno attivate per 0,5 secondi. Il comando della tapparella da locale può essere fatto solamente con 2 pulsanti di comando, uno per la salita e uno per la discesa. Partendo con la tapparella alzata, premendo il pulsante di discesa la tapperella inizia a scendere per il tempo programmato. Se si vuole fermare la tapparella in un punto qualsiasi bisogna premere il pulsante inverso al movimento, quindi se si sta abbassando basta premere il pulsante per l’apertura. A quel punto, con la tapparella ferma è possibile premere nuovamente il pulsante di apertura o di chiusura per far ripartire il movimento. Tramite Maxi Manager e Comelit app è anche possibile impostare la tapparella ad una posizione intermedia rispetto allo 0% completamente aperta, 100% completamente chiusa e visualizzarne lo stato percentuale. La posizione percentuale viene calcolata in relazione al tempo di corsa impostato. I comandi eseguiti verso uscite configurate come "Tapparella" devono essere di tipo NORMALE. Non vengono considerati dal modulo comandi di SET e RESET sull’uscita configurata come "Tapparella".

madchicken commented 3 years ago

From what I read there with your module is possible to fully implement 0-100% opening close of the blind without using tricks in the code (like I had to do with mine). I can allow you to configure each blind with a different opening/closing time, but for your module is definitely better to implement it using the right API. To help me you could do this: install the comelit-client like descibed here https://github.com/madchicken/comelit-client. Then launch the command:

comelit info --id GEN#17#13#1

Send me the output. Then execute this command:

comelit listen

play a bit with the blind and send me the output

madchicken commented 3 years ago

@tomasell Any updates on this☝️?

tomasell commented 3 years ago

Due to covid, the shipment is on delay and the electrician had to postpone the installation. I will update you as soon as I have installed and tried the new module. I suppose the next week.

tomasell commented 3 years ago

Hi @madchicken , I've installed this module today. Using this module during the day, i notice that two main features are missing on Comelit application:

I attach comelit_info.log

and logs of this flow: 100%closed ( starting point ) -> 80% ( first action ) -> 100% closed ( second action ) blinds.log

Thanks for support!

madchicken commented 3 years ago

Sorry, I didn't get which feature is not available. Are you talking about blinds opening and closing with percentage? Regarding the second point: the plugin has a blind opening/closing time you can specify from the config (blind_closing_time). By default it is set to 35 seconds. You can tune it according to your installation (sorry, right now it's a global configuration, I'll improve it and let you specify a opening/closing time "per blind" with the next release). Once you are done with it, you should open your blinds completely and restart homebridge. At that point you should be able to use them properly

tomasell commented 3 years ago

Are you talking about blinds opening and closing with percentage?

Yes, you can set percentage only using Comelit application, instead you cannot do it using Comelit Maxi ( it doesn't support it ). IMG_8492

I'm not sure, but i suppose that the Homebridge plugin works in that way: when you run the open blind command and you set 50% , a task will wait for ( 35* 0.5 ) seconds to run the stop command. Instead, using the new module, you can set the percentage : reading logs, it looks like that 255 position value is closed and 0 is open. You don't need blind_closing_time because you have to send only the percentage.

madchicken commented 3 years ago

I'm not sure, but i suppose that the Homebridge plugin works in that way: when you run the open blind command and you set 50% , a task will wait for ( 35* 0.5 ) seconds to run the stop command. Instead, using the new module, you can set the percentage : reading logs, it looks like that 255 position value is closed and 0 is open. You don't need blind_closing_time because you have to send only the percentage.

Yes, that is what I need to fix for your device (it has a different type from "classics open/closed blinds")

tomasell commented 3 years ago

Do you already know the meaning of all JSON properties printed in log?

{
  "req_type": 0,
  "req_sub_type": -1,
  "obj_id": "DOM#BL#39.1",
  "out_data": [
    {
      "id": "DOM#BL#39.1",
      "type": 2,
      "sub_type": 31,
      "sched_status": "0", \\ "set by SimpleProg"
      "sched_lock": "1970-01-01 01:00:00",  \\ "unset by SimpleProg"
      "status": "1", \\ "domain is {0,1,2}"
      "powerst": "1", \\ "domain is {0,1,2}"
      "position": "255", \\ "255 closed - 0 open"
      "open_status": "0",
      "preferPosition": "127", \\ "set 50% by  SimpleProg"
      "enablePreferPosition": "1" \\ "set by SimpleProg"
    }
  ],
  "status":  "NaN"
}

If you need more info, i can try this afternoon.

madchicken commented 3 years ago

Hi @tomasell I just updated the comelit-client. Can you please update it and the do a test on your system? Just try this commands:

comelit blinds

It should give back something like

DOM#BL#19.1 - Tapparella destra (status UP)
DOM#BL#20.1 - Tapparella sinistra (status UP)
DOM#BL#21.1 - Tapparella cucina (status UP)
DOM#BL#22.1 - Tapparella bagno giorno (status UP)
DOM#BL#23.1 - Tapparella bagno notte (status UP)
DOM#BL#24.1 - Tapparella camera da letto (status UP)

Then take one of your blind id and try to set it to some mid position:

comelit blinds --toggle DOM#BL#19.1 --perc 75

Let me know if it works, so I can update the homebridge plugin as well

tomasell commented 3 years ago

Thanks @madchicken , i'll try it tomorrow. I'm searching your updates, but I cannot see any new commit in comelit-client.

madchicken commented 3 years ago

I published on npm, just do a

npm -g update comelit-client@latest

tomasell commented 3 years ago

Hi @madchicken , i'm using v2.3.0 and It doesn't work blinds.log perc.log

madchicken commented 3 years ago

Sorry for my delay @tomasell I should have fixed the problem in version 2.3.1. Can you try it?

tomasell commented 3 years ago

Hi @madchicken , i can confirm that using v2.3.1 version i can set percentage. I attach a log because if you set 0, the blind will open as expected, but the script doesn't exit and after few seconds the hub receive a close command. perc0.log

madchicken commented 3 years ago

Fixed in 2.6.0

tomasell commented 3 years ago

did you have already fixed the issue if you set 0 value as percentage?

tomasell commented 3 years ago

Hi @madchicken , i'm using the 2.6.1 plugin, i've deleted all previous accessories and i've discovered the new ones. About blind, i can see that if you set 50% open, plugin do it as well, but if i check the status after few seconds you cannot see the real percentage. IMG_8571 IMG_8572

madchicken commented 3 years ago

I see, that's a bug in the update function. Sorry for that, but without a real test is hard to implement things in the proper way. I'll fix this in the next few days

tomasell commented 3 years ago

Hi @madchicken , finally i can test the new feature. But I think I'm doing something wrong (maybe i've done a mistake when i give you the detail, i'm sorry). As first I have deleted all accessories, then I've updated the plugin , I've opened all the windows and I've done a reboot. I'm setting 49% as starting point; then , using home app, i'm setting 66% open. When it has been done, i see that the blind is closed as 66% . Then i pres close button, the blind will totally open.

As second point , it looks like when i set 0, after few seconds blind will open automatically, i've already post the log in previuos message https://github.com/madchicken/homebridge-comelit-hub/issues/34#issuecomment-782593047.

madchicken commented 3 years ago

So is it working at the opposite? It seems to me that 0 for Comelit is totally open while is totally closed for HomeKit

madchicken commented 3 years ago

Zero problem fixed in client v2.3.2