0

我收到以下输入:

$aws/things/siemens-logo/shadow/update
{
  "state": {
    "reported": {
      "I..1:1-1": "01"
    }
  }
}

如何重新发布该值,如下所示:

office/rgb1/light/status
{
   "state": "ON",
}

我坚持使用 SQL 语句。

SQL:SELECT VALUE state from '$aws/things/siemens-logo/shadow/update'

*我找到了以下页面:https ://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-json.html

4

1 回答 1

1
SELECT    CASE get(state.reported,"I..1:1-1") 
            WHEN '01' 
            THEN 'ON' 
            ELSE 'OFF' 
          END AS state 
FROM      '$aws/things/siemens-logo/shadow/update' 
于 2020-12-13T21:59:37.093 回答