mysa-js-sdk
    Preparing search index...

    Function getDeviceTrackedSensor

    • Reads the sensor an in-floor heating thermostat is configured to regulate against from its device record.

      The device record returned by MysaApiClient.getDevices stores the selection as Tracking, with the same encoding as the trackedSnsr field of real-time status messages. Unlike those messages, it is available without a real-time connection, which makes it the only source of the selection on accounts where the real-time stream never delivers anything. It is a snapshot: a later change made in the Mysa app shows up only in a fresh device record or a real-time status message.

      Parameters

      Returns MysaTrackedSensor | undefined

      The configured sensor, or undefined when the record carries no recognized selection — as for every device that is not an in-floor thermostat.

      const devices = await client.getDevices();
      const trackedSensor = getDeviceTrackedSensor(devices.DevicesObj['device123']);