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

Allow to retrieve and use arrays in variables #22

Open
kalon33 opened this issue Dec 30, 2023 · 0 comments
Open

Allow to retrieve and use arrays in variables #22

kalon33 opened this issue Dec 30, 2023 · 0 comments

Comments

@kalon33
Copy link

kalon33 commented Dec 30, 2023

I just bought a SenseCAP T1000A that I added to TTN, in order to use it through Home Assistant. It has a pretty complex payload (see https://github.com/Seeed-Solution/SenseCAP-Decoder/blob/main/T1000/TTN/SenseCAP_T1000_TTN_Decoder.js for the decoder), that send multiple measurements into the messages variable, and "state" values through their own variables.

Would it be possible to be able to retrieve informations in messages variable and split them into their own variables in HA? Currently I'm not able to retrieve anything in messages in HA, but other values (app_id, dev_id, err, errMessage, num, payload and valid) are properly set.

Here is an extract from what is generated on TTN side:

"decoded_payload": {
        "err": 0,
        "messages": [
          [
            {
              "measurementId": "4200",
              "measurementValue": [],
              "motionId": 0,
              "timestamp": 1703937567000,
              "type": "Event Status"
            },
            {
              "measurementId": "5002",
              "measurementValue": [
                {
                  "mac": "DE:25:4F:59:7E:02",
                  "rssi": "-87"
                },
                {
                  "mac": "12:3B:6A:1B:AB:B2",
                  "rssi": "-91"
                },
                {
                  "mac": "FD:9E:33:84:D2:C7",
                  "rssi": "-92"
                }
              ],
              "motionId": 0,
              "timestamp": 1703937567000,
              "type": "BLE Scan"
            },
            {
              "measurementId": "4097",
              "measurementValue": 17.4,
              "motionId": 0,
              "timestamp": 1703937567000,
              "type": "Air Temperature"
            },
            {
              "measurementId": "4199",
              "measurementValue": 6,
              "motionId": 0,
              "timestamp": 1703937567000,
              "type": "Light"
            },
            {
              "measurementId": "3000",
              "measurementValue": 96,
              "motionId": 0,
              "timestamp": 1703937567000,
              "type": "Battery"
            }
          ]
        ],
        "payload": "08000000006590061fde254f597e02a9123b6a1babb2a5fd9e3384d2c7a400ae000660",
        "valid": true
      }

Thanks for your help!

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

1 participant