Edge App Academy · 1 / 5
Name the incoming state handler
Create the portable definition and a named entry point for plant messages.
YOUR TASK
Make this happen
Build plant-monitor with a receive handler loading scripts/receive.lua.
Check the complete solution, then inspect any unmet requirements.
Read the starter files
main.cococo
edge_app_document "main" {
format = "1"
handle = "plant-monitor"
name = "Plant monitor"
handlers = [edge_app_handler.receive]
}
handlers.cococo
edge_app_handler "receive" {
name = "receive"
# Source file supplied for this field: scripts/receive.lua
# TODO: attach it with source = file(...).
}
scripts/receive.lua
bridge.log.info(params.topic) return params.payload
Supplied supporting files
Reference: edge-apps · getting-startededge-apps · definitionsedge-apps · scripts-triggersedge-apps · mqtt-opcuaedge-apps · industrialedge-apps · exec-httpedge-apps · diagnosticsedge-apps · reference