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

Positionable Horizontal Awning does not report "vent" status #144

Open wagaman opened 1 month ago

wagaman commented 1 month ago

Thank you very much for offering this great API. I own a Positionable Horizontal Awning which automatically retracts when a strong wind is detected. In the application, it shows

Upstair Right Strong winds

This is a very useful sensor which I would like to have in HA for safety reasons. For example, I would set the roller shutter not extending for one hour after "vent" sensor reported "on".

I downloaded diagnosis for this product and do not think that such "vent" sensor is exposed yet.

Could you please take a look and let me know if this sensor can be included in the local api reporting?

Thank you very much in advance.


        {
          "deviceURL": "io://****-****-***/37***50",
           "type": 1,
          "definition": {
            "widgetName": "PositionableRollerShutter",
            "attributes": [
              {
                "name": "core:Manufacturer"
              },
              {
                "name": "core:FirmwareRevision"
              },
              {
                "name": "core:SupportedManufacturerSettingsCommands"
              }
            ],
            "type": "ACTUATOR",
            "states": [
              {
                "name": "core:TargetClosureState"
              },
              {
                "name": "core:ClosureState"
              },
              {
                "name": "core:SecuredPositionState"
              },
              {
                "name": "core:DiscreteRSSILevelState"
              },
              {
                "name": "core:RSSILevelState"
              },
              {
                "name": "core:AdditionalStatusState"
              },
              {
                "name": "core:Memorized1PositionState"
              },
              {
                "name": "core:ManufacturerSettingsState"
              },
              {
                "name": "core:ManufacturerDiagnosticsState"
              },
              {
                "name": "core:NameState"
              },
              {
                "name": "core:BatteryState"
              },
              {
                "name": "core:CommandLockLevelsState"
              },
              {
                "name": "core:OpenClosedState"
              },
              {
                "name": "core:StatusState"
              },
              {
                "name": "core:MovingState"
              }
            ],
            "commands": [
              {
                "nparams": 0,
                "commandName": "open"
              },
              {
                "nparams": 0,
                "commandName": "keepOneWayControllersAndDeleteNode"
              },
              {
                "commandName": "pairOneWayController",
                "nparams": 1,
                "paramsSig": "p1,*p2"
              },
              {
                "nparams": 0,
                "commandName": "identify"
              },
              {
                "nparams": 0,
                "commandName": "getName"
              },
              {
                "nparams": 0,
                "commandName": "up"
              },
              {
                "nparams": 0,
                "commandName": "my"
              },
              {
                "commandName": "removeLockLevel",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "stop"
              },
              {
                "commandName": "setName",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "commandName": "setMemorized1Position",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "commandName": "setDeployment",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "down"
              },
              {
                "commandName": "wink",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "commandName": "delayedStopIdentify",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "unpairAllOneWayControllers"
              },
              {
                "nparams": 0,
                "commandName": "stopIdentify"
              },
              {
                "commandName": "runManufacturerSettingsCommand",
                "nparams": 2,
                "paramsSig": "p1,p2"
              },
              {
                "commandName": "advancedRefresh",
                "nparams": 1,
                "paramsSig": "p1,*p2"
              },
              {
                "commandName": "setConfigState",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "startIdentify"
              },
              {
                "nparams": 0,
                "commandName": "close"
              },
              {
                "commandName": "addLockLevel",
                "nparams": 1,
                "paramsSig": "p1,*p2"
              },
              {
                "nparams": 0,
                "commandName": "resetLockLevels"
              },
              {
                "nparams": 0,
                "commandName": "sendIOKey"
              },
              {
                "nparams": 0,
                "commandName": "unpairAllOneWayControllersAndDeleteNode"
              },
              {
                "commandName": "setSecuredPosition",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "commandName": "setPosition",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "commandName": "unpairOneWayController",
                "nparams": 1,
                "paramsSig": "p1,*p2"
              },
              {
                "commandName": "setClosure",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "refreshMemorized1Position"
              }
            ],
            "uiClass": "RollerShutter"
          },
          "controllableName": "io:RollerShutterWithBatterySomfyIOComponent",
          "synced": true,
          "enabled": true,
          "attributes": [
            {
              "name": "core:Manufacturer",
              "value": "Somfy",
              "type": 3
            },
            {
              "name": "core:FirmwareRevision",
              "value": "5151298A15",
              "type": 3
            }
          ],
          "available": true,
          "states": [
            {
              "name": "core:CommandLockLevelsState",
              "value": [],
              "type": 11
            },
            {
              "name": "core:StatusState",
              "value": "available",
              "type": 3
            },
            {
              "name": "core:DiscreteRSSILevelState",
              "value": "good",
              "type": 3
            },
            {
              "name": "core:RSSILevelState",
              "value": 82,
              "type": 1
            },
            {
              "name": "core:ClosureState",
              "value": 100,
              "type": 1
            },
            {
              "name": "core:OpenClosedState",
              "value": "closed",
              "type": 3
            },
            {
              "name": "core:TargetClosureState",
              "value": 100,
              "type": 1
            },
            {
              "name": "core:MovingState",
              "value": false,
              "type": 6
            },
            {
              "name": "core:BatteryState",
              "value": "full",
              "type": 3
            },
            {
              "name": "core:NameState",
              "value": "** **",
              "type": 3
            },
            {
              "name": "core:Memorized1PositionState",
              "value": 85,
              "type": 1
            }
          ],
          "subsystemId": 0,
          "label": "** **"
        },
        {
          "deviceURL": "io://****-****-**0/15******",
          "type": 1,
          "definition": {
            "widgetName": "PositionableHorizontalAwning",
            "attributes": [
              {
                "name": "core:Manufacturer"
              },
              {
                "name": "core:FirmwareRevision"
              },
              {
                "name": "core:SupportedManufacturerSettingsCommands"
              }
            ],
            "type": "ACTUATOR",
            "states": [
              {
                "name": "core:TargetClosureState"
              },
              {
                "name": "core:SecuredPositionState"
              },
              {
                "name": "core:ManufacturerSettingsState"
              },
              {
                "name": "core:AdditionalStatusState"
              },
              {
                "name": "core:Memorized1PositionState"
              },
              {
                "name": "core:DiscreteRSSILevelState"
              },
              {
                "name": "core:RSSILevelState"
              },
              {
                "name": "core:ManufacturerDiagnosticsState"
              },
              {
                "name": "core:OpenClosedState"
              },
              {
                "name": "core:DeploymentState"
              },
              {
                "name": "core:CommandLockLevelsState"
              },
              {
                "name": "core:NameState"
              },
              {
                "name": "core:StatusState"
              },
              {
                "name": "core:MovingState"
              }
            ],
            "commands": [
              {
                "nparams": 0,
                "commandName": "my"
              },
              {
                "commandName": "delayedStopIdentify",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "unpairAllOneWayControllers"
              },
              {
                "nparams": 0,
                "commandName": "stopIdentify"
              },
              {
                "commandName": "runManufacturerSettingsCommand",
                "nparams": 2,
                "paramsSig": "p1,p2"
              },
              {
                "commandName": "advancedRefresh",
                "nparams": 1,
                "paramsSig": "p1,*p2"
              },
              {
                "commandName": "setConfigState",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "startIdentify"
              },
              {
                "commandName": "setMemorized1Position",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "commandName": "addLockLevel",
                "nparams": 1,
                "paramsSig": "p1,*p2"
              },
              {
                "nparams": 0,
                "commandName": "resetLockLevels"
              },
              {
                "nparams": 0,
                "commandName": "sendIOKey"
              },
              {
                "nparams": 0,
                "commandName": "unpairAllOneWayControllersAndDeleteNode"
              },
              {
                "commandName": "setSecuredPosition",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "commandName": "setPosition",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "commandName": "unpairOneWayController",
                "nparams": 1,
                "paramsSig": "p1,*p2"
              },
              {
                "commandName": "setDeployment",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "refreshMemorized1Position"
              },
              {
                "commandName": "setName",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "keepOneWayControllersAndDeleteNode"
              },
              {
                "commandName": "pairOneWayController",
                "nparams": 1,
                "paramsSig": "p1,*p2"
              },
              {
                "nparams": 0,
                "commandName": "identify"
              },
              {
                "nparams": 0,
                "commandName": "getName"
              },
              {
                "nparams": 0,
                "commandName": "up"
              },
              {
                "commandName": "wink",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "close"
              },
              {
                "commandName": "setClosure",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "open"
              },
              {
                "nparams": 0,
                "commandName": "down"
              },
              {
                "nparams": 0,
                "commandName": "stop"
              },
              {
                "commandName": "removeLockLevel",
                "nparams": 1,
                "paramsSig": "p1"
              },
              {
                "nparams": 0,
                "commandName": "undeploy"
              },
              {
                "nparams": 0,
                "commandName": "deploy"
              }
            ],
            "uiClass": "Awning"
          },
          "controllableName": "io:HorizontalAwningIOComponent",
          "synced": true,
          "enabled": true,
          "attributes": [
            {
              "name": "core:Manufacturer",
              "value": "Somfy",
              "type": 3
            },
            {
              "name": "core:FirmwareRevision",
              "value": "5164665A03",
              "type": 3
            },
            {
              "name": "core:SupportedManufacturerSettingsCommands",
              "value": [
                "dead_man_down",
                "dead_man_impulse_down",
                "dead_man_impulse_up",
                "dead_man_stop",
                "dead_man_up",
                "delete_my_position",
                "double_power_cut",
                "eject_from_setting_mode",
                "enter_back_impulse_setting_mode",
                "enter_settings_mode",
                "invert_rotation",
                "reset_actuator",
                "save_back_impulse_position",
                "save_lower_end_limit",
                "save_my_position",
                "save_settings",
                "save_upper_end_limit",
                "set_dbe_up",
                "set_unstressing_status",
                "stop_after_save_limit"
              ],
              "type": 10
            }
          ],
          "available": true,
          "states": [
            {
              "name": "core:StatusState",
              "value": "available",
              "type": 3
            },
            {
              "name": "core:CommandLockLevelsState",
              "value": [],
              "type": 11
            },
            {
              "name": "core:DiscreteRSSILevelState",
              "value": "normal",
              "type": 3
            },
            {
              "name": "core:RSSILevelState",
              "value": 60,
              "type": 1
            },
            {
              "name": "core:ManufacturerSettingsState",
              "value": {
                "current_position": 51200
              },
              "type": 11
            },
            {
              "name": "core:OpenClosedState",
              "value": "open",
              "type": 3
            },
            {
              "name": "core:TargetClosureState",
              "value": 100,
              "type": 1
            },
            {
              "name": "core:DeploymentState",
              "value": 100,
              "type": 1
            },
            {
              "name": "core:MovingState",
              "value": false,
              "type": 6
            },
            {
              "name": "core:NameState",
              "value": "** **",
              "type": 3
            },
            {
              "name": "core:Memorized1PositionState",
              "value": 50,
              "type": 1
            }
          ],
          "subsystemId": 0,
          "label": "** **"
        }
wagaman commented 1 month ago

I did some HTTP sniffing today.

curl -H "Host: ha101-1.overkiz.com" -H "Accept: */*" -H "Content-Type: application/json" -H "X-OVK-API-Key: " -H "X-OVK-Application-Id: tahoma3-ios" -H "Accept-Language: en-GB,en;q=0.9" -H "Authorization: Bearer " -H "User-Agent: TaHoma/408 CFNetwork/1496.0.7 Darwin/23.5.0" --compressed "https://ha101-1.overkiz.com/enduser-mobile-web/enduserAPI/history"

With this, I am able to get the wind warning. It returns a list of warnings. The sample is here:

[{"deviceEvent":{"eventTime":1729164385970,"deviceURL":"io://**/**","id":"**","type":"WARNING","subType":"PRIORITY_LOCK__WIND_FORCING_AVAILABLE"}},{"deviceEvent":{"eventTime":1729164352257,"deviceURL":"io://**/**","id":"**","type":"WARNING","subType":"PRIORITY_LOCK__WIND_FORCING_UNAVAILABLE"}},

I believe the PRIORITY_LOCK__WIND_FORCING_AVAILABLE indicates the warning. I found this variable here: https://github.com/iMicknl/python-overkiz-api/blob/main/pyoverkiz/enums/general.py