Somfy-Developer / Somfy-TaHoma-Developer-Mode

A collection of requests to use a local API with Somfy TaHoma gateways
147 stars 12 forks source link

no reacton on orientation/tilt/slate command to exterior venetian blind motor #103

Closed j1schmid closed 5 months ago

j1schmid commented 1 year ago

I have a Somfy J4 motor at an exterior venetian blind motor. On the iPhone App the position and tilt angle of the blind can be monitored and adjusted. Via local API, one can set a position using the command setClosure but the target tilt angle is rather random. The commands setClosureAndOrientation and setOrientation do not work at all, the motor does not react. The response to the curl command looks same as with the working command setClosure.

llavorel-somfy commented 1 year ago

Hi @j1schmid Do you have an example on how you are using those commands ?

j1schmid commented 1 year ago

Hi @llavorel-somfy

I have a generated and actived a token via linux shell / command line.

POD="XXXX-XXXX-XXXX"
TOKEN=...

The following command returns a larg json string:

curl -X GET \
    "https://gateway-${POD}.local:8443/enduser-mobile-web/1/enduserAPI/setup/devices" \
    -H "accept: application/json" \
    -H "Authorization: Bearer ${TOKEN}" | jq

The json string a kind of describes lots of commands. The simple commands without parameter open, close, up, down, stop, stop, identify, startIdentify and stopIdentify work fine:

curl -X 'POST' \
  "https://gateway-${POD}.local:8443/enduser-mobile-web/1/enduserAPI/exec/apply" \
  -H 'accept: application/json' \
  -H "Authorization: Bearer ${TOKEN}" \
  -H 'Content-Type: application/json' \
  -d '{
  "label": "Bad/Rollladen",
  "actions": [
    {
      "commands": [
        {
          "name": "open"
        }
      ],
      "deviceURL": "io://2029-4882-6640/9516745"
    }
  ]
}'

The command setClosure also let the blind act:

curl -X 'POST' \
  "https://gateway-${POD}.local:8443/enduser-mobile-web/1/enduserAPI/exec/apply" \
  -H 'accept: application/json' \
  -H "Authorization: Bearer ${TOKEN}" \
  -H 'Content-Type: application/json' \
  -d '{
  "actions": [
    {
      "commands": [
        {
          "name": "setClosure",
          "parameters": [
            "10"
          ]
        }
      ],
      "deviceURL": "io://2029-4882-6640/9516745"
    }
  ]
}'

But as mentioned in the original comment, the resulting tilt angle is rather weird. Starting with completly open blinds. Then setClosure down to 10, 20, 30 or 90, the blind goes doen and the motor rotates back such that the tilt ends horizontal. After setting setClosure to 100, the tilt will end up vertical. Then setClosure to 90, 80, ..., 10, the tilt is always vertical. After setting setClosure to 0, the blinds tilt end up horizontal.

However, using the commands setOrientation and setPosition with integer values between 0 and 100 in the parameter list, nothing happens, for example:

curl -X 'POST' \
  "https://gateway-${POD}.local:8443/enduser-mobile-web/1/enduserAPI/exec/apply" \
  -H 'accept: application/json' \
  -H "Authorization: Bearer ${TOKEN}" \
  -H 'Content-Type: application/json' \
  -d '{
  "actions": [
    {
      "commands": [
        {
          "name": "setOrientation",
          "parameters": [
            "10"
          ]
        }
      ],
      "deviceURL": "io://2029-4882-6640/9516745"
    }
  ]
}'

The response

{"execId":"d8392bc7-701b-4d57-a399-37f6e6f07a36"}

looks like as with the working commands, but the blind does not act at all.

shockbytes commented 1 year ago

Same for me. I am not able to tilt it. Everything else works like a charm. I tried the same methods mentioned above but also with the same result.

flhoest commented 1 year ago

Guys, I have exactly the same behavior ... anyone found a way to deal with it ?

lhaemmerle commented 9 months ago

I just tried this myself yesterday and I can confirm that the actions setOrientation and setPosition are successfully issued but no reaction from the (Somfy) motors. At least with (several) tiltUp und tiltDown one can rotate the shutters but this is not ideal.

GrzegorzRomanczuk commented 7 months ago

I have just tried it with J4 IO protect motor. I still dont work to control slates position via API.

@llavorel-somfy do you plan to make it works?

j1schmid commented 6 months ago

I wonder if Somfy is interested at all in that regard? In any case, I won't be recommending or installing any more Somfy devices as long as nothing happens.

shockbytes commented 6 months ago

@j1schmid agree. It effectively makes the API usage unusable because you can't close the blinds at all.

lhaemmerle commented 6 months ago

@shockbytes : Even though it would nice Somfy would fix this issue, the API is not unusable. One can fully close the blinds or open them or put them to the my position. It's also possible to close the blindes e.g. 20%. But with this bux one cannot rotate them to a certain value. The only way to rotate them is with tilt but you would have to execute this several times, which is not ideal.

GrzegorzRomanczuk commented 6 months ago

The worst in it is not the bug itself but the lack of response from Somfy and lack of declaration that they are willing to fix the bug.

llavorel-somfy commented 5 months ago

Hi everyone, We are still trying to characterize the issue to understand if the problem comes from the gateway, from the motor or from a peculiar configuration of the motor. Sorry that it takes so much time.

GrzegorzRomanczuk commented 5 months ago

@llavorel-somfy i tried it with tahoma switch. I could control slates with tahoma app. I could not control slates with API.

j1schmid commented 5 months ago

@llavorel-somfy Same for me, I can control the slate from the Tahoma app. But can not control the slate via API.

lhaemmerle commented 5 months ago

@llavorel-somfy Same here. (iOS) app works, the above-mentioned API commands don't. Let us know if we can help you figure out the issue (e.g. looking up model numbers of motor etc).

llavorel-somfy commented 5 months ago

Hi @lhaemmerle @j1schmid @GrzegorzRomanczuk We cannot reproduce your issue with Somfy J4 IO Protect : https://www.somfy.fr/produits/1210673/j4-io-protect-6-24

Do you use this reference of product or another one ?

If it is the same, we need to analyze if you are using a specific configuration. Have you installed your products yourself or have you been through a professionnal installer ? If you have a professionnal installer, do you know if he is using TaHoma PRO services ?

Would you accept to share your SerialNumber (POD="XXXX-XXXX-XXXX") ?

j1schmid commented 5 months ago

@llavorel-somfy In my case it is a "J410 io PROTECT" 10nM 24rpm, the POD is 2029-4882-6640. The motor was installed by a professional installer, but whether he is using TaHoma PRO services, i do not know.

lhaemmerle commented 5 months ago

Good news. When I tried again to set the orientation with the following request, it worked as expected:

{
    "label": "myAction",
    "actions": [
        {
            "commands": [
                {
                    "name": "setClosureAndOrientation",
                    "parameters": [
                        20,
                        50
                    ]
                }
            ],
            "deviceURL": "io:\/\/2059-0798-5225\/0000000"
        }
    ]
}

Also setOrientation worked now as expected. So, it seems that this bug was fixed in the past few months (I have not tried this again since February).

lhaemmerle commented 5 months ago

An alternative explanation why it works now (at least in my case) is that the parameters p1 and p2 apparently have to be integers. I could imagine that in my first attempts they were sent as strings (e.g. "20", "50"). Just as a hint for others :-)

j1schmid commented 5 months ago

@lhaemmerle Thanks a lot, removing the quotes helped. Now it works as expected.

shockbytes commented 5 months ago

Thanks a lot, removing the quotes helped and it works now. Strangely though, I can still send strings for the setClosure command, so there is still some inconsistency in here.

llavorel-somfy commented 5 months ago

Hi This is a really good news !

lhaemmerle commented 5 months ago

Good to know it works now also for others by sending the parameters as integers :-) From a developer perspective, it was not obvious for me that these values have to be integers. Some error messages in the response or some additional documentation (e.g. example requests) might have helped to find the cause earlier.