brink icon indicating copy to clipboard operation
brink copied to clipboard

Added support for CO2-sensors

Open yunusdemir opened this issue 9 months ago • 3 comments

Closes #20

I've been able to confirm the CO2-sensor data in HA, but the temperature and humidity aren't shown for me. I think we'd need to use a different API route for that. It seems there is a v1.1 API available, but I currently don't have the time to refactor and implement that.

Quick screenshot from the data that is available for me: image

Full disclosure: this PR was quickly made with https://claude.ai

yunusdemir avatar Feb 26 '25 13:02 yunusdemir

Hi,

Thanks for contributing!!!

I do not have a CO2 sensor. Maybe you could enable debug logs and share Response result: in JSON? I want to validate whether this code is correct.

We are using mobile app API as this one on the web is very unclear; if someone could find out how to work with that API, I would help implement it as it has many more fields.

I wrote to Brink for the documentation 2 years ago, but they said they cant share that information.

samuolis avatar Feb 26 '25 18:02 samuolis

Makes sense that you would like to validate! I have an older debug statement, I think below is what you need.

Regarding the web api, I'm down to put in some work to get the v1.1 API to work, but that might take a bit of a longer time as I'm quite busy at the moment!

Logs (I've formatted the json to be more readable):

2025-02-26 14:27:31.237 DEBUG (MainThread) [custom_components.brink_ventilation.core.brink_home_cloud] Response result:

{
  "menuItems": [
    {
      "guiId": 32000,
      "pages": [
        {
          "name": "Home",
          "imageName": "ic_home",
          "pageType": 1,
          "parameterDescriptors": [
            {
              "uiId": "Status Filtermeldung",
              "valueId": 741417,
              "sortId": 0,
              "subBundleId": 0,
              "parameterId": 24006,
              "readWrite": 1,
              "noDataPoint": false,
              "name": "Status Filtermeldung",
              "controlType": 0,
              "value": "0",
              "valueState": 1,
              "hasDependentParameter": false,
              "listItems": [
                {
                  "value": "0",
                  "displayText": "Not dirty",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "1",
                  "displayText": "Dirty",
                  "isSelectable": true,
                  "highlightIfSelected": false
                }
              ]
            },
            {
              "uiId": "Lüftungsstufe",
              "valueId": 741421,
              "sortId": 0,
              "subBundleId": 0,
              "parameterId": 24011,
              "readWrite": 3,
              "noDataPoint": false,
              "name": "Lüftungsstufe",
              "controlType": 0,
              "value": "3",
              "valueState": 1,
              "hasDependentParameter": false,
              "listItems": [
                {
                  "value": "0",
                  "displayText": "Stufe 0",
                  "imageName": "Icon_Lueftungsstufe_0.png",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "1",
                  "displayText": "Stufe 1",
                  "imageName": "Icon_Lueftungsstufe_1.png",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "2",
                  "displayText": "Stufe 2",
                  "imageName": "Icon_Lueftungsstufe_2.png",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "3",
                  "displayText": "Stufe 3",
                  "imageName": "Icon_Lueftungsstufe_3.png",
                  "isSelectable": true,
                  "highlightIfSelected": false
                }
              ]
            },
            {
              "uiId": "Betriebsart",
              "valueId": 741422,
              "sortId": 0,
              "subBundleId": 0,
              "parameterId": 24012,
              "readWrite": 3,
              "noDataPoint": false,
              "name": "Betriebsart",
              "controlType": 0,
              "value": "0",
              "valueState": 1,
              "hasDependentParameter": false,
              "listItems": [
                {
                  "value": "0",
                  "displayText": "Automatikbetrieb",
                  "imageName": "ic_automatic.png",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "1",
                  "displayText": "Handbetrieb",
                  "imageName": "ic_hand.png",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "2",
                  "displayText": "Urlaubbetrieb",
                  "imageName": "ic_vacation.png",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "3",
                  "displayText": "Partybetrieb",
                  "imageName": "ic_party.png",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "4",
                  "displayText": "Nachtlüftungsbetrieb",
                  "imageName": "ic_night.png",
                  "isSelectable": true,
                  "highlightIfSelected": false
                }
              ]
            },
            {
              "uiId": "Restlaufzeit Betriebsartfunktion",
              "valueId": 741423,
              "sortId": 0,
              "subBundleId": 0,
              "parameterId": 24013,
              "readWrite": 1,
              "noDataPoint": false,
              "name": "Restlaufzeit Betriebsartfunktion",
              "controlType": 6,
              "value": "0",
              "valueState": 1,
              "hasDependentParameter": false,
              "listItems": [],
              "minValue": 0,
              "maxValue": 480,
              "stepWidth": 1,
              "decimals": 0
            }
          ]
        },
        {
          "name": "Info",
          "imageName": "ic_info",
          "pageType": 0,
          "parameterDescriptors": [
            {
              "valueId": 741440,
              "sortId": 0,
              "subBundleId": 0,
              "parameterId": 24024,
              "readWrite": 1,
              "noDataPoint": false,
              "name": "Status Bypassklappe",
              "controlType": 0,
              "value": "4",
              "valueState": 1,
              "hasDependentParameter": false,
              "listItems": [
                {
                  "value": "0",
                  "displayText": "Initialisierung",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "1",
                  "displayText": "Öffnet",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "2",
                  "displayText": "Schließt",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "3",
                  "displayText": "Geöffnet",
                  "isSelectable": true,
                  "highlightIfSelected": false
                },
                {
                  "value": "4",
                  "displayText": "Geschlossen",
                  "isSelectable": true,
                  "highlightIfSelected": false
                }
              ]
            },
            {
              "valueId": 741443,
              "sortId": 0,
              "subBundleId": 0,
              "parameterId": 24027,
              "readWrite": 1,
              "noDataPoint": false,
              "name": "PPM eBus CO2-sensor 1",
              "controlType": 6,
              "value": "577",
              "valueState": 1,
              "hasDependentParameter": false,
              "listItems": [],
              "decimals": 0
            },
            {
              "valueId": 741444,
              "sortId": 0,
              "subBundleId": 0,
              "parameterId": 24028,
              "readWrite": 1,
              "noDataPoint": false,
              "name": "PPM eBus CO2-sensor 2",
              "controlType": 6,
              "value": "632",
              "valueState": 1,
              "hasDependentParameter": false,
              "listItems": [],
              "decimals": 0
            }
          ]
        }
      ]
    }
  ]
}

yunusdemir avatar Feb 27 '25 08:02 yunusdemir

It took me quite a bit longer to work on this, apologies for that! I think I have updated the PR with all the comments you had :)

yunusdemir avatar Jul 08 '25 16:07 yunusdemir