While I’m off learning about the new Cloud API - just a quick link to my current SmartApp code:
Here, I’m trying to define an endpoint in the mappings section, which references a function (?) called listMeters.
I cobbled that function together by making edits to the listSwitches example above - but I’m guessing the syntax:
resp << [name: it.displayName, value: it.currentValue(“powerMeter”)]
is incorrect - at least, I’m getting a null response whenever I hit that endpoint (using Postman or curl).
As an interesting (to me) aside / clue: This code, executed in the Simulator OR on my mobile device, does in fact allow the selection of the (4) devices I have deployed with powerMeter or energyMeter capabilities - based on the addition of these two lines to the preferences section:
input "powerMeters", "capability.powerMeter", title: "Power meters", required: false, multiple: true
input "energyMeters", "capability.energyMeter", title: "Energy meters", required: false, multiple: true
Still doesn’t get me quite where I want to be - but feels like incremental progress.
Peace!