lokonli / slide-domoticz-local

GNU General Public License v3.0
2 stars 1 forks source link

Not working in (latest) Domoticz 2024 version. #2

Closed bvhoesel closed 3 months ago

bvhoesel commented 3 months ago

Since the Slide cloud is is going to be shut down I tried to switch to this local Domoticz plugin.

Unfortunately this is not working at the moment. After enabling the plugin and entering the needed Slide info there is no movement of the curtain when using the open or close buttons in Domoticz.

The following curl command do work, showing the Slide is in local mode:

curl http://x.x.x.x/rpc/Slide.GetInfo

curl -X POST \ 'x.x.x.x/rpc/Slide.SetPos' \ --header 'Accept: /' \ --header 'Content-Type: application/json' \ --data-raw '{ "pos": 0.5 }'

And with expected results of the info asked and partially closing the curtains. Even without authentication! Needed info taken from the provided postman files.

After activating 'All' debug of the plugin there is no error information on using the open and close buttons. Only the (successful) heartbeats show in the log:

Slide: onCommand called for Unit 1: Parameter 'Close', Level: 0 Status: User: admin (IP: 172.21.143.11) initiated a switch command (515/Slide - Slide/Close) Slide: onHeartbeat called

Direct setting the slider does generate some debug log. The log shows the (expected) url to be executed but nothing is moving. And a general error is shown:

Error: Slide: Transport is not connected, write directive to 'Slide_266' ignored.

The only way I discovered to get some action from Domoticz is using the slider with exact values 1 and 99 to open and close the curtains. Other values trigger no action.

This issue looks al lot like the 'latest' issue solved for the cloud plugin from December 2022.

Is there any change this plugin can be fixed and be working again in the latest Domoticz? I really would appreciate that. Might also be great and useful for others who want (need) to migrate to a local solution.

Thanks in advance.

lokonli commented 3 months ago

Yes, I noticed the same, and will look into it this weekend.

bvhoesel commented 3 months ago

Did some more testing. If there is movement the stop command (from a 'binds + stop' device) does work. The previous mentioned exact values 1 and 99 are not the whole situation. I also get sometimes movement if I move the slider (very) slow with a back and forward move. Then it will pick up a position setting and sends is successfully to the Slide. Looking at the debug logs is seems that (most of the time) a successful call starts with something like:

Pushing 'onCommandCallback' on to queue Processing 'onCommandCallback' message Slide: Acquiring GIL for 'onCommandCallback' Calling message handler 'onCommand' on 'module' type object. onCommand called for Unit 1: Parameter 'Set Level', Level: 1

And it has a hex dump of the /rpc/Slide.SetPos url to send.

A failing call starts with something like:

Part 1: 86... Part 2: 5c... {"Verb": ...snipped... }

This gives the impression as if parts of the code are not executed because the plugin 'onCommand' debug message is missing. And it is missing the SetPos hex dump. So it seems the command is never send to the Slide.

bvhoesel commented 3 months ago

And ... to complicate things ...

I added my second Slide to the local config. Now I get a more or less consistent error every 30 seconds (no slide actions from my side, heartbeat?). The errors vary from the 3 below

Error: Slide: Failed to connect (125) to: x.x.x.x with error: Operation canceled Error: Slide: No transport, write directive to 'Slide_32' ignored. Error: Slide: Transport is not connected, write directive to 'Slide_88' ignored.

The IP it cannot connect to is the first IP address added! No issue apparently with the newly added IP?

lokonli commented 3 months ago

Can you test latest version?

lokonli commented 3 months ago

Solved with #6

bvhoesel commented 3 months ago

Thanks for the quick solution. If I may add one comment still? It is working with the setting 'Reverse Position:' enabled. (Yes I do use a position to not fully open the curtain).