Hi,
I purchased a Shelly Plus 1 EM to monitor the daily usage of an appliance and to trigger a notification if the appliance used more than some many KW in a day. I did this with using the following (it's not the complete script - just the bit relevant to this thread) :-
Let startMonitor = True
Let maxEnergy = 4000000
Let eAccumulator = 0
Shelly.addStatusHandler(function (event, user_data) {
print(JSON.stringify(event));
if (typeof event.delta.aenergy !== "undefined") {
print (startMonitor);
print(JSON.stringify(event.delta.aenergy["by_minute"]));
if (startMonitor) {
eAccumulator = eAccumulator + event.delta.aenergy.by_minute[0];
print (eAccumulator = eAccumulator + event.delta.aenergy.by_minute[0]);
if (eAccumulator > maxEnergy) {
print(eAccumulator, "4Kw used consumed");.....................................
I've now brought a Shelly Pro EM and would like to do the same for each of the Clamps for the circuits they are monitoring. I know I need to split the Clamp data in my script. However my issue is what values / variable to monitor. This there a similar value / variable like event.delta.aenergy["by_minute"] I can use with the Shelly Pro EM?
Please note I'm a complete beginner to this and finding this scripting language hard to grasp. So I hope the above makes some sense.
TIA