Unit 5: Stimulating Water Meter Data¶
After the routing rule and alert rule are configured, you can now use HTTP request to stimulate the sending of the measurement points by the water meter.
Step 1: Generating the HTTP Request URL¶
Format: http://{protocolGatewayId}.{address}:{port}{path}
protocolGatewayId: The system generated ID when the procotol gateway is successfully created in Unit 2.
address and port: Get the information by logging in to EnOS Management Console and click Help > Environment Information at the top right, under Third-party Connection.
path: The route entered for Protocol Route when creating the protocol gateway in Unit 2, in this case:
/post
.
Step 2: Stimulating Value to Trigger Alert¶
Use the example code below to stimulate a value that is over 10000 in order to trigger the alert.
{ "identifier": "assetId", //the asset ID of the water meter "msgType": "deviceReq", "hasMore": 0, "dtag": 1, "data": [ { "serviceId": "NBWaterMeterCommon", "serviceData": { "meterId": "xxxx", "dailyActivityTime": 120, "flow": 21234, //value over 10000 "cellId": "5656", "signalStrength": "99", "batteryVoltage": 3.5 }, "eventTime": 1635934569742 }, { "serviceId": "waterMeter", "serviceData": { "internalTemperature": "667" }, "eventTime": 1635934569742 } ] }
In EnOS Management Console, select Alert Engine > Alert Records, and the alert will be shown.
Step 3: Stimulating Value to Stop Alert¶
Use the example code below to stimulate a value that is lower than 10000 in order to stop the alert.
{ "identifier": "XolflP2C", "msgType": "deviceReq", "hasMore": 0, "dtag": 1, "data": [ { "serviceId": "NBWaterMeterCommon", "serviceData": { "meterId": "xxxx", "dailyActivityTime": 120, "flow": 3321, "cellId": "5656", "signalStrength": "99", "batteryVoltage": 3.5 }, "eventTime": 1635934569742 }, { "serviceId": "waterMeter", "serviceData": { "internalTemperature": "667" }, "eventTime": 1635934569742 } ] }
In EnOS Management Console, select Alert Engine > Alert Records, and the alert will no longer be shown under real-time alerts.