Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for FTW04 #49

Open
gaetancollaud opened this issue Dec 31, 2023 · 8 comments
Open

Support for FTW04 #49

gaetancollaud opened this issue Dec 31, 2023 · 8 comments

Comments

@gaetancollaud
Copy link
Owner

We should easily be able to support sensors like the FTW04.
The implementation should be similar to metterings, we could do a pooling every now and then for the sensors and report the value to MQTT.

Since I personally don't own such devices it will be difficult for me to implement but I can try to mock the response. If someone would be kind enough to run this command and give me the result, I would appreciate it (don't hesitate to remove personal information I just need an example) ? This command will get the current status of the appartment (including the sensors value).

curl -k -X GET --location "https://HOSTNAME:8080/api/v1/apartment/status?include=installation,dsDevices,submodules,functionBlocks,zones,clusters,applications,dsServer,controllers,apiRevision,meterings" -H "Authorization: Bearer API_KEY"

Structure example:

{
  "data": {
    "included": {
      "dsDevices": [
        {
          "id": "302ed89f43f0000000002d000004345d00",
          "type": "dsDevice",
          "attributes": {
            "name": "Room 2",
            "gtin": "4251161900036",
            "dsid": "302ed89f43f02d000004345d",
            "displayId": "0004345d",
            "present": true,
            "submodules": [
              "302ed89f43f0000000002d000004345d00"
            ],
            "zone": "1",
            "controller": "302ed89f43f0000000000e400000c9bb00"
          }
        }
      ],
      "submodules": [
        {
          "id": "302ed89f43f0000000002d000004345d00",
          "type": "submodule",
          "attributes": {
            "name": "Room 2",
            "technicalName": "FTW04 dS",
            "dsDevice": "302ed89f43f0000000002d000004345d00",
            "functionBlocks": [
              "302ed89f43f0000000002d000004345d00"
            ],
            "zone": "1",
            "application": "joker"
          }
        }
      ],
      "functionBlocks": [
        {
          "id": "302ed89f43f0000000002d000004345d00",
          "type": "functionBlock",
          "attributes": {
            "name": "Room 2",
            "technicalName": "FTW04 dS",
            "active": true,
            "sensorInputs": [
              {
                "id": "0",
                "attributes": {
                  "technicalName": "Sensor#0"
                }
              },
              {
                "id": "1",
                "attributes": {
                  "technicalName": "Sensor#1"
                }
              },
              {
                "id": "2",
                "attributes": {
                  "technicalName": "Sensor#2",
                  "type": "temperature"
                }
              },
              {
                "id": "3",
                "attributes": {
                  "technicalName": "Sensor#3",
                  "type": "humidity"
                }
              }
            ],
            "submodule": "302ed89f43f0000000002d000004345d00",
            "deviceAdapter": "302ed89f43f0000000002d000004345d00"
          }
        }
      ]
    }
  }
}
@jtognazzi
Copy link

jtognazzi commented Dec 31, 2023

This looks good !

here is the result

Edited by @gaetancollaud to keep only the revelant part and keep this thread short.

{
  "data": {
    "type": "apartmentStatus",
    "included": {
      "dsDevices": [
        {
          "id": "302ed89f43f0000000002d000004345d00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000002d000004345d00"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000002d000004345d00",
                "operationsLocked": false
              }
            ]
          }
        }
      ],
      "zones": [],
      "userDefinedStates": []
    }
  }
}

@gaetancollaud
Copy link
Owner Author

Thanks @jtognazzi but I don't see the values of the sensors, could you try this one please:

curl -k -X GET --location "https://HOSTNAME:8080/api/v1/apartment/dsDevices/status" -H "Authorization: Bearer API_KEY"

Il will edit your previous answer to keep only the important part

@jtognazzi
Copy link

Actually, the temperature and humidity values appears under the zones list as type zoneStatus.
I can see them with this request:
/api/v1/apartment/status?include=zones

{
  "data": {
    "id": "77fd4a11-87cf-456a-b12e-0467c8195a23",
    "type": "apartmentStatus",
    "attributes": {
      "access": {
        "absent": false
      },
      "user": {
        "sleeping": false
      },
      "security": {
        "panic": false,
        "fire": false,
        "alarm1": false,
        "alarm2": false,
        "alarm3": false,
        "alarm4": false
      },
      "temperature": {
        "mode": "automatic",
        "ecoPreferred": false
      },
      "weather": {
        "wind": false,
        "rain": false,
        "hail": false,
        "frost": false,
        "dayNight": "day",
        "condition": "804",
        "icon": "04d"
      },
      "environment": {
        "sunrise": "2024-01-01T07:15:47.000Z",
        "sunset": "2024-01-01T15:50:30.000Z",
        "dawn": "2024-01-01T06:40:30.000Z",
        "dusk": "2024-01-01T16:25:47.000Z"
      },
      "measurements": {
        "temperature": 4.7999999999999998
      }
    },
    "included": {
      "dsDevices": [
        {
          "id": "302ed89f43f0000000000e80000408c700",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000000e80000408c700"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000000e80000408c700",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "302ed89f43f0000000000e80000429cd00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000000e80000429cd00"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000000e80000429cd00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "302ed89f43f0000000000e80000429d100",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000000e80000429d100"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000000e80000429d100",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "302ed89f43f0000000000e80000429d200",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000000e80000429d200"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000000e80000429d200",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "302ed89f43f0000000000e80000429d500",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000000e80000429d500"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000000e80000429d500",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "302ed89f43f0000000002d000004345d00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000002d000004345d00"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000002d000004345d00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "302ed89f43f0000000002d000004348800",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000002d000004348800"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000002d000004348800",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "302ed89f43f0000000002d00000434da00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000002d00000434da00"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000002d00000434da00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "302ed89f43f0000000002d00000434dd00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000002d00000434dd00"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000002d00000434dd00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "302ed89f43f0000000002d00000434de00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "302ed89f43f0000000002d00000434de00"
              }
            ],
            "submodules": [
              {
                "id": "302ed89f43f0000000002d00000434de00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000000f00000f596700",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000000f00000f596700",
                "outputs": [
                  {
                    "id": "shadePositionOutside",
                    "value": 100.0,
                    "status": "ok",
                    "targetValue": 100.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000000f00000f596700",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000000f00000f9e3700",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000000f00000f9e3700",
                "outputs": [
                  {
                    "id": "shadePositionOutside",
                    "value": 100.0,
                    "status": "ok",
                    "targetValue": 100.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000000f00000f9e3700",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000000f00000f9e3800",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000000f00000f9e3800",
                "outputs": [
                  {
                    "id": "shadePositionOutside",
                    "value": 100.0,
                    "status": "ok",
                    "targetValue": 100.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000000f00000f9e3800",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000000f00000f9e4900",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000000f00000f9e4900",
                "outputs": [
                  {
                    "id": "shadePositionOutside",
                    "value": 100.0,
                    "status": "ok",
                    "targetValue": 100.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000000f00000f9e4900",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000000f00000f9e4a00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000000f00000f9e4a00",
                "outputs": [
                  {
                    "id": "shadePositionOutside",
                    "value": 100.0,
                    "status": "ok",
                    "targetValue": 100.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000000f00000f9e4a00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000001680000e49e800",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000001680000e49e800"
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000001680000e49e800",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000001680000e49ea00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000001680000e49ea00"
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000001680000e49ea00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000001680000e655000",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000001680000e655000"
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000001680000e655000",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000001680000e655200",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000001680000e655200"
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000001680000e655200",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000001680000e658c00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000001680000e658c00"
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000001680000e658c00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "303505d7f800000000001680000e658e00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "303505d7f800000000001680000e658e00"
              }
            ],
            "submodules": [
              {
                "id": "303505d7f800000000001680000e658e00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "592ecffc37be552980c9c29fe60563a900",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "592ecffc37be552980c9c29fe60563a900",
                "outputs": [
                  {
                    "id": "brightness",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "hue",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "saturation",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "colortemp",
                    "value": 452.94117647058823,
                    "status": "ok",
                    "targetValue": 452.94117647058823
                  },
                  {
                    "id": "x",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "y",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "592ecffc37be552980c9c29fe60563a900",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "7f9f1906530a5484c083195e5ad7894100",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "7f9f1906530a5484c083195e5ad7894100",
                "outputs": [
                  {
                    "id": "brightness",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "colortemp",
                    "value": 368.23529411764707,
                    "status": "ok",
                    "targetValue": 368.23529411764707
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "7f9f1906530a5484c083195e5ad7894100",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "ade7e6ab04b059ddc02e4fa20d60ebcb00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "ade7e6ab04b059ddc02e4fa20d60ebcb00",
                "outputs": [
                  {
                    "id": "brightness",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "ade7e6ab04b059ddc02e4fa20d60ebcb00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "b607570f4e585721809d3edc73e00cb500",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "b607570f4e585721809d3edc73e00cb500",
                "outputs": [
                  {
                    "id": "brightness",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "hue",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "saturation",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "colortemp",
                    "value": 368.23529411764707,
                    "status": "ok",
                    "targetValue": 368.23529411764707
                  },
                  {
                    "id": "x",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "y",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "b607570f4e585721809d3edc73e00cb500",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "ba1b6dd0fbc3566880fdb9c00dceebb500",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "ba1b6dd0fbc3566880fdb9c00dceebb500",
                "outputs": [
                  {
                    "id": "brightness",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "hue",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "saturation",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "colortemp",
                    "value": 368.23529411764707,
                    "status": "ok",
                    "targetValue": 368.23529411764707
                  },
                  {
                    "id": "x",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "y",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "ba1b6dd0fbc3566880fdb9c00dceebb500",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "c2eee0095e1e5040808bdf7f912e962900",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "c2eee0095e1e5040808bdf7f912e962900",
                "outputs": [
                  {
                    "id": "brightness",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "hue",
                    "value": 296.47058823529414,
                    "status": "ok",
                    "targetValue": 296.47058823529414
                  },
                  {
                    "id": "saturation",
                    "value": 100.0,
                    "status": "ok",
                    "targetValue": 100.0
                  },
                  {
                    "id": "colortemp",
                    "value": 452.94117647058823,
                    "status": "ok",
                    "targetValue": 452.94117647058823
                  },
                  {
                    "id": "x",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "y",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "c2eee0095e1e5040808bdf7f912e962900",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "c8b7a4ea8aa15509c0a9820da76d208a00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "c8b7a4ea8aa15509c0a9820da76d208a00"
              }
            ],
            "submodules": [
              {
                "id": "c8b7a4ea8aa15509c0a9820da76d208a00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "e761caaf0a7554a580863c25892946bc00",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "e761caaf0a7554a580863c25892946bc00",
                "outputs": [
                  {
                    "id": "brightness",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "colortemp",
                    "value": 230.58823529411765,
                    "status": "ok",
                    "targetValue": 230.58823529411765
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "e761caaf0a7554a580863c25892946bc00",
                "operationsLocked": false
              }
            ]
          }
        },
        {
          "id": "f6061fb0e5b95bc8808ffff6ef8247f300",
          "type": "dsDeviceStatus",
          "attributes": {
            "functionBlocks": [
              {
                "id": "f6061fb0e5b95bc8808ffff6ef8247f300",
                "outputs": [
                  {
                    "id": "brightness",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "hue",
                    "value": 79.058823529411768,
                    "status": "ok",
                    "targetValue": 79.058823529411768
                  },
                  {
                    "id": "saturation",
                    "value": 93.725490196078425,
                    "status": "ok",
                    "targetValue": 93.725490196078425
                  },
                  {
                    "id": "colortemp",
                    "value": 452.94117647058823,
                    "status": "ok",
                    "targetValue": 452.94117647058823
                  },
                  {
                    "id": "x",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  },
                  {
                    "id": "y",
                    "value": 0.0,
                    "status": "ok",
                    "targetValue": 0.0
                  }
                ]
              }
            ],
            "submodules": [
              {
                "id": "f6061fb0e5b95bc8808ffff6ef8247f300",
                "operationsLocked": false
              }
            ]
          }
        }
      ],
      "zones": [
        {
          "id": "1",
          "type": "zoneStatus",
          "attributes": {
            "measurements": {
              "temperature": 19.125,
              "humidity": 54.774999999999999
            },
            "applications": [
              {
                "mode": "automatic",
                "status": "heating",
                "emergency": false,
                "setpoint": 20.0,
                "controlValue": 90.0,
                "lastCalledScene": "heatingComfort",
                "setbackRequested": false,
                "ecoPreferred": false,
                "passiveCooling": false,
                "id": "temperature"
              }
            ]
          }
        },
        {
          "id": "2",
          "type": "zoneStatus",
          "attributes": {
            "measurements": {
              "temperature": 18.449999999999999,
              "humidity": 71.25
            },
            "applications": [
              {
                "mode": "automatic",
                "status": "neutral",
                "emergency": false,
                "setpoint": 17.0,
                "controlValue": 0.0,
                "lastCalledScene": "heatingSetback",
                "setbackRequested": true,
                "ecoPreferred": true,
                "passiveCooling": false,
                "id": "temperature"
              }
            ]
          }
        },
        {
          "id": "3",
          "type": "zoneStatus",
          "attributes": {
            "measurements": {
              "temperature": 19.574999999999999,
              "humidity": 61.774999999999999
            },
            "applications": [
              {
                "mode": "automatic",
                "status": "neutral",
                "emergency": false,
                "setpoint": 19.0,
                "controlValue": 0.0,
                "lastCalledScene": "heatingEconomy",
                "setbackRequested": false,
                "ecoPreferred": true,
                "passiveCooling": false,
                "id": "temperature"
              }
            ]
          }
        },
        {
          "id": "4",
          "type": "zoneStatus",
          "attributes": {
            "measurements": {
              "temperature": 18.125,
              "humidity": 54.450000000000003
            },
            "applications": [
              {
                "status": "off",
                "nonLocalPriority": "off",
                "area1": "off",
                "area2": "off",
                "area3": "off",
                "area4": "off",
                "id": "lights"
              },
              {
                "mode": "automatic",
                "status": "neutral",
                "emergency": false,
                "setpoint": 12.0,
                "controlValue": 0.0,
                "lastCalledScene": "heatingSetback",
                "setbackRequested": true,
                "ecoPreferred": false,
                "passiveCooling": false,
                "id": "temperature"
              }
            ],
            "scenarios": [
              {
                "id": "applicationZone-z4-g1-s31",
                "status": "inactive",
                "scheduledAt": "2022-11-06T08:20:47.874Z",
                "terminatesAt": "2022-11-06T08:20:47.874Z"
              }
            ]
          }
        },
        {
          "id": "5",
          "type": "zoneStatus",
          "attributes": {
            "applications": [
              {
                "status": "off",
                "nonLocalPriority": "off",
                "area1": "off",
                "area2": "off",
                "area3": "off",
                "area4": "off",
                "id": "lights"
              },
              {
                "status": "open",
                "nonLocalPriority": "open",
                "area1": "open",
                "area2": "open",
                "area3": "open",
                "area4": "open",
                "id": "shades"
              }
            ]
          }
        },
        {
          "id": "6",
          "type": "zoneStatus",
          "attributes": {
            "measurements": {
              "temperature": 21.324999999999999,
              "humidity": 51.100000000000001
            },
            "applications": [
              {
                "status": "off",
                "nonLocalPriority": "off",
                "area1": "off",
                "area2": "off",
                "area3": "off",
                "area4": "off",
                "id": "lights"
              },
              {
                "status": "open",
                "nonLocalPriority": "open",
                "area1": "open",
                "area2": "open",
                "area3": "open",
                "area4": "open",
                "id": "shades"
              },
              {
                "mode": "automatic",
                "status": "heating",
                "emergency": false,
                "setpoint": 20.5,
                "controlValue": 75.0,
                "lastCalledScene": "heatingComfort",
                "setbackRequested": false,
                "ecoPreferred": false,
                "passiveCooling": false,
                "id": "temperature"
              }
            ]
          }
        },
        {
          "id": "65534",
          "type": "zoneStatus"
        }
      ],
      "clusters": [
        {
          "id": "16",
          "type": "clusterStatus",
          "attributes": {
            "operationsLocked": false
          }
        },
        {
          "id": "17",
          "type": "clusterStatus",
          "attributes": {
            "operationsLocked": false
          }
        },
        {
          "id": "18",
          "type": "clusterStatus",
          "attributes": {
            "operationsLocked": false
          }
        },
        {
          "id": "19",
          "type": "clusterStatus",
          "attributes": {
            "operationsLocked": false
          }
        }
      ],
      "userDefinedStates": [
        {
          "id": "1560282334",
          "type": "userDefinedStateStatus",
          "attributes": {
            "status": "inactive"
          }
        },
        {
          "id": "1567681517",
          "type": "userDefinedStateStatus",
          "attributes": {
            "status": "inactive"
          }
        },
        {
          "id": "1684412544",
          "type": "userDefinedStateStatus",
          "attributes": {
            "status": "inactive"
          }
        },
        {
          "id": "dev.302ed89f43f0000000002d00000434de00.type9.1539893297",
          "type": "userDefinedStateStatus",
          "attributes": {
            "status": "inactive"
          }
        }
      ]
    }
  }
}

and following your request pattern, I tried this request also
/api/v1/apartment/zones/status

{
  "data": [
    {
      "id": "1",
      "type": "zoneStatus",
      "attributes": {
        "measurements": {
          "temperature": 17.949999999999999,
          "humidity": 49.625
        },
        "applications": [
          {
            "mode": "automatic",
            "status": "heating",
            "emergency": false,
            "setpoint": 20.0,
            "controlValue": 100.0,
            "lastCalledScene": "heatingComfort",
            "setbackRequested": false,
            "ecoPreferred": false,
            "passiveCooling": false,
            "id": "temperature"
          }
        ]
      }
    },
    {
      "id": "2",
      "type": "zoneStatus",
      "attributes": {
        "measurements": {
          "temperature": 18.475000000000001,
          "humidity": 71.25
        },
        "applications": [
          {
            "mode": "automatic",
            "status": "neutral",
            "emergency": false,
            "setpoint": 17.0,
            "controlValue": 0.0,
            "lastCalledScene": "heatingSetback",
            "setbackRequested": true,
            "ecoPreferred": true,
            "passiveCooling": false,
            "id": "temperature"
          }
        ]
      }
    },
    {
      "id": "3",
      "type": "zoneStatus",
      "attributes": {
        "measurements": {
          "temperature": 19.625,
          "humidity": 62.149999999999999
        },
        "applications": [
          {
            "mode": "automatic",
            "status": "neutral",
            "emergency": false,
            "setpoint": 19.0,
            "controlValue": 0.0,
            "lastCalledScene": "heatingEconomy",
            "setbackRequested": false,
            "ecoPreferred": true,
            "passiveCooling": false,
            "id": "temperature"
          }
        ]
      }
    },
    {
      "id": "4",
      "type": "zoneStatus",
      "attributes": {
        "measurements": {
          "temperature": 18.050000000000001,
          "humidity": 62.350000000000001
        },
        "applications": [
          {
            "status": "off",
            "nonLocalPriority": "off",
            "area1": "off",
            "area2": "off",
            "area3": "off",
            "area4": "off",
            "id": "lights"
          },
          {
            "mode": "automatic",
            "status": "neutral",
            "emergency": false,
            "setpoint": 12.0,
            "controlValue": 0.0,
            "lastCalledScene": "heatingSetback",
            "setbackRequested": true,
            "ecoPreferred": false,
            "passiveCooling": false,
            "id": "temperature"
          }
        ],
        "scenarios": [
          {
            "id": "applicationZone-z4-g1-s31",
            "status": "inactive",
            "scheduledAt": "2022-11-06T08:20:47.874Z",
            "terminatesAt": "2022-11-06T08:20:47.874Z"
          }
        ]
      }
    },
    {
      "id": "5",
      "type": "zoneStatus",
      "attributes": {
        "applications": [
          {
            "status": "off",
            "nonLocalPriority": "off",
            "area1": "off",
            "area2": "off",
            "area3": "off",
            "area4": "off",
            "id": "lights"
          },
          {
            "status": "open",
            "nonLocalPriority": "open",
            "area1": "open",
            "area2": "open",
            "area3": "open",
            "area4": "open",
            "id": "shades"
          }
        ]
      }
    },
    {
      "id": "6",
      "type": "zoneStatus",
      "attributes": {
        "measurements": {
          "temperature": 21.350000000000001,
          "humidity": 55.825000000000003
        },
        "applications": [
          {
            "status": "off",
            "nonLocalPriority": "off",
            "area1": "off",
            "area2": "off",
            "area3": "off",
            "area4": "off",
            "id": "lights"
          },
          {
            "status": "open",
            "nonLocalPriority": "open",
            "area1": "open",
            "area2": "open",
            "area3": "open",
            "area4": "open",
            "id": "shades"
          },
          {
            "mode": "automatic",
            "status": "heating",
            "emergency": false,
            "setpoint": 20.5,
            "controlValue": 71.0,
            "lastCalledScene": "heatingComfort",
            "setbackRequested": false,
            "ecoPreferred": false,
            "passiveCooling": false,
            "id": "temperature"
          }
        ]
      }
    },
    {
      "id": "65534",
      "type": "zoneStatus"
    }
  ]
}

I hope it helps.

@gaetancollaud
Copy link
Owner Author

Sorry for truncating your first message a bit too quickly. I didn't checked the zones.

It's interesting, this means instead of focusing on the devices sensors I could concentrate on the zones. And I see that the application temperature has a setpoint attribute. Maybe we could try to mutate this field to expose some thermostat feature from MQTT... I will investigate.

Thanks for your help

@gaetancollaud
Copy link
Owner Author

Actually my dss server doesn't expose the temperature application, so it wil be really tricky for me to test.

Could you try this and tell me if it has any effect on our system ? The response will be empty but maybe you can see in digitalStrom web UI that something changed. BE AWARE, this will modify the set point of your zone number 6: Salon to 20.0°

curl -X PATCH --location "https://HOSTNAME:8080/api/v1/apartment/zones/6/status" \
    -H "Authorization: Bearer API_KEY" \
    -H "Content-Type: application/json" \
    -d '[
          {
            "op": "replace",
            "path": "/applications/temperature/setpoint",
            "value": 20
          }
        ]'

I'v see that you also have a different set point for different mode like night etc. so i've no idea what the behavior will be regarding this application (again I don't have it I cannot test it myself). Those settings cannot be set through the API, so maybe it's a dead end anyway.

@jtognazzi
Copy link

Yes, it worked !
I have a "Climate Control App" in the web UI to configure everything regarding the Central Heating...

image

@gaetancollaud
Copy link
Owner Author

Cool, thanks for the confirmation. I have this app, but no devices so it's in "off" mode all the time.

I could try to start implementing, but it would be a lot of back and forth with you and would be realy tidious.

I've reached to digitalStrom AG to see if they can lend me a device to test. I don't need them and I personnaly don't want to invest 200chf (FTW04) + 100chf (BL) for an opensource app that I already develop on my free time. Let's hope they accept.

@jtognazzi
Copy link

Sure, I fully understand.
Let's hope DigitalStrom AG will want to support your work...

Thanks anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants