jbasen / Crestron-Shelly

26 stars 1 forks source link

Cover 2PM : position problem #42

Open OZEO-DOOZ opened 2 months ago

OZEO-DOOZ commented 2 months ago

Hi,

When I try to use the position with a PRO Cover module, it does not work.

Capture d’écran 2024-09-30 155353

the level transmited is always "0".

jbasen commented 2 months ago

Does the command work at all? When comparing the command to the Shelly API documentation it should work fine. The issue appears to be that the the ContentString being returned by the http request is sort of null but not really. I've recently run into this problem with another Shelly device (I wish I could remember which one). My code tests for IsNullOrEmpty and it says the ContentString contains content when in reality it just contains some junk that prints "null" in a debugging print statement.

FYI - the API that matches the http call is here:

https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Cover#covergotoposition-example

Thanks

OZEO-DOOZ commented 2 months ago

No the command does not work because it always send pos=0. but if I put manualy in my browser pos=20, then it works

OZEO-DOOZ commented 2 months ago

the analog value the I send with the Crestron, is always convert in to "pos=0".

jbasen commented 2 months ago

Thanks for the clarification. That is very helpful.

The Shelly Pro cover module has 2 channels (0 and 1). Does this occur with both channels or just the second channel that you are showing in the console messages in your earlier post?

Thanks again

jbasen commented 2 months ago

This looks like a very simple fix. Change the code at line 384 of the file Shelly Roller v3.1.usp to the following:

THREADSAFE CHANGE Shade_1_Position { Trace("Shelly Roller - EventHandler - Shade_1_Position = %d\n", Shade_1_Position); If ((Startup_Lock = 2) && (Cover_Count = 2)) { myShelly.Send_Roller_Command(Device_IP, Device_Gen, 1, 4, Shade_1_Position, "", ""); } }

Let me know if this fixes the problem for you.

Thanks