I am using a WeMos D1 R2 with a custom shield to communicate with a Hiking DDS238-2 ZN/S electricity meter via RS485 MODBUS RTU.
In plain English, that just means that the electricity meter is attached to the house mains and is continuously sensing instantaneous values like voltage, current and frequency. The WeMos D1 R2 is polling the meter at regular intervals via a MAX485 module to retrieve the values, after which they are transmitted whenever CAYENNE_OUT_DEFAULT() is called.
This has all been working perfectly since April 2018 so the data is getting to Cayenne OK.
Some time ago I set up a trigger to send me an email if the grid voltage exceeded 253.0 volts AC. This is the theoretical upper limit of the nominal 240V supply in the part of Australia where I live. I realise that the previous sentence is off-topic but I did not want anyone who lives in a 110V jurisdiction to assume that 253V was a ridiculous value.
If memory serves, I set up this trigger using the web interface to Cayenne. Since it was set up, the trigger has fired 1054 times so (a) it is definitely working and (b) I have plenty of data to show that it fires precisely according to its definition of “over 253.0”.
Today, I decided to create two more triggers, this time on the grid frequency. The nominal frequency is 50Hz and the limits of normal behaviour are 49.85Hz and 50.15Hz. Thus the first trigger should fire if the frequency falls below 49.85 and the second trigger should fire if the frequency rises above 50.15.
The web UI for a new trigger has four associated controls: min, step, value, max. Unless I’m looking in the wrong place (Cayenne docs, Features, Triggers, Setting up triggers), the Cayenne documentation does not seem to show this arrangement so this is probably a documentation error (BUG #1).
I cancelled the first new trigger I was intending to create and revisited the voltage trigger I created some time ago. The values it showed me in the UI were min=0, step=1, value=20, max=20 which obviously had nothing to do with 253V.
I wondered if my memory was faulty and if I had created the voltage trigger via the iOS app but when I went into the app on my iPad, it did not want to show me any triggers at all, despite the fact that the voltage trigger has fired many times.
I went back to the web interface and this time forged ahead to create a “below” trigger with the values min=0, step=1, value=49.85, max=60; plus an “above” trigger with the values min=0, step=1, value=50.15, max=60.
Those seemed to “stick” in the sense that they were accepted but when I re-opened each definition, the UI showed me min=0, step=1, value=20, max=20.
Having created the two new triggers via the web, I went back to the iOS app. It still would not show me any triggers at all, and that’s when I decided to start writing this bug report.
Then, while re-tracing my steps, the iOS app “came good” and started to show me all three triggers. What is interesting is that the iOS UI has fields for “min” and “max” plus an unnamed field that corresponds with “value” but no field for “step”.
I have no idea what the “step” field is meant to do. If it is a supported parameter then it should be documented and added to the iOS app. If it is an unsupported parameter that has somehow crept into the web UI then it should probably be removed. (BUG #2)
Given that the iOS app ultimately proved capable of showing the actual values of the trigger parameters, while the web app will only ever show 0/1/20/20, it seems to me that the web UI is deficient in this regard and should be fixed. (BUG #3)
Why the iOS app was initially unable to show me the voltage trigger (created ages ago), then was unable to show me the newly-created frequency triggers, then was able to show me all three triggers is a bit of a mystery but I’m assuming it was a transient problem. For the record, the iOS app is version 2.3. It was not running the first time I went into it today but I did force-quit and re-launch before re-checking whether it would show me the triggers.
I’m attaching screen shots from both the web and iOS user interfaces.