rule engine
stone ... 2021-01-25 Less than 1 minute
#
# 一、Create channel
# 1、Select the aisle in the top navigation bar, click to create channel
# 2、Select the channel type, belong to the application, fill in the channel name, etc.
# 一、Add rule
# 1、Select the rule on the top navigation bar and click Add
- Select the client connection event, filter the device whose Username is'ammeter' and get the connection information:
SELECT clientid, connected_at FROM "$events/client_connected" WHERE username = 'ammeter'
1
- Select the client disconnection event, filter the devices whose Username is'ammeter' and get the disconnection information:
SELECT clientid, disconnected_at FROM "$events/client_disconnected" WHERE username = 'ammeter'
1
- Select the message posted to the topic thing/9cc13a64f7/ammeter_001/post, and filter out the "clientid","payload","topic" fields from the message content:
SELECT clientid, payload, topic FROM "thing/9cc13a64f7/ammeter_001/post"
1
- Fill in the Regular SQL and add the Responsive action
- Select the corresponding channel
- Note: Every time you add a channel, you need to restart the corresponding channel, that is, disable the channel and then enable it