I see that position 844 has the "alarm": "temperature"
, so it doesn't seem to be an event issue. Are you using computed attributes for it? Are you sure the formula is correct?
Hi Anton,
Yes, I use computedAttribute for this purpose.
Triggers
id | description | type | attribute | expression |
---|---|---|---|---|
16 | CA Low Temperature | boolean | isLowTemp | tempCalculated ? tempCalculated < io21 ? true : false : null |
17 | CA Hi Temperature | boolean | isHiTemp | tempCalculated ? tempCalculated > io22 ? true : false : null |
Alarms
id | description | type | attribute | expression |
---|---|---|---|---|
18 | Alarm Hi Temp | string | alarm | isHiTemp ? 'temperature' : null |
19 | Alarm Low Temp | string | alarm | isLowTemp ? 'temperature' : null |
Calculated Attributes for each device
id | description | type | attribute | expression |
---|---|---|---|---|
1 | temp R_A.TC-07 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -40.9) ? io11 - 1 : ((io11 <= -41.00) && (io11 >= -46.9)) ? io11 - 2 : ((io11 <= -47.00) && (io11 >= -65.9) ? io11 - 3 : io11 : null |
2 | Temp R_B.TC-00 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -65.9)) ? io11 - 4 : io11: null |
3 | Temp R_B.TC-01 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -65.9)) ? io11 - 3 : io11: null |
4 | Temp R_B.TC-02 | number | tempCalculated | io11 ? (io11 <=200.00) && (io11 >= -100)) ? io11 - 4 : io11 : null |
5 | temp R_B.TC-03 | number | tempCalculated | io11 ? (io11 <=200.00) && (io11 >= -100)) ? io11 - 3 : io11 : null |
6 | Temp R_B.TC-04 | number | tempCalculated | io11 ? (io11 <=200.00) && (io11 >= -100)) ? io11 - 3 : io11 : null |
8 | Temp R_B.TC-00 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -40.9) ? io11 - 1 : ((io11 <= -41.00) && (io11 >= -65.9)) ? io11 - 2 : io11 : null |
9 | Temp R_A.TC-00 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -40.9)) ? io11 - 5 : ((io11 <= -41.00) && (io11 >= -65.9)) ? io11 - 6 : io11 : null |
10 | Temp R_A.TC-01 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -40.9)) ? io11 - 1 : ((io11 <= -41.00) && (io11 >= -46.9)) ? io11 - 2 : ((io11 <= -47.00) && (io11 >= -53.9) ? io11 - 3 : ((io11 <= -54.00) && (io11 >= -59.9) ? io11 - 4 : ((io11 <= -60.00) && (io11 >= -65.9) ? io11 - 5 : io11 : null |
11 | Temp R_A.TC-02 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -46.9)) ? io11 - 1 : ((io11 <= -47.00) && (io11 >= -65.9)) ? io11 - 2 : io11 : null |
12 | temp R_A.TC-03 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -46.9) ? io11 - 4 : ((io11 <= -47.00) && (io11 >= -65.9)) ? io11 - 5 : io11 : null |
13 | Temp R_A.TC-04 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -56.9)) ? io11 - 6 : ((io11 <= -57.00) && (io11 >= -65.9)) ? io11 - 7 : io11 : null |
14 | Temp R_A.TC-05 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -46.9) ? io11 - 4 : ((io11 <= -47.00) && (io11 >= -65.9)) ? io11 - 5 : io11 : null |
15 | Temp R_A.TC-06 | number | tempCalculated | io11 ? (io11 <= -30.00) && (io11 >= -56.9)) ? io11 - 6 : ((io11 <= -57.00) && (io11 >= -65.9)) ? io11 - 7 : io11 : null |
For each device I have made a link for the corresponding calculation
tc_device_attribute
deviceid | attributeid |
---|---|
30 | 10 |
30 | 16 |
30 | 17 |
30 | 18 |
30 | 19 |
Wait. You have multiple computed attributes that depend on each other? How does that work?
;)
Well, it works as I described it. Not very well ;)
Each device generates an alarm, but the notification arrives with the next item and the notification contains the attributes of the new position.
Give me some hint, my idea is that the measured temperature needs recalculation. And this recalculation is different for each device.
Do you have attribute copying?
Yes, I have for groups
id | name | groupid | attributes |
---|---|---|---|
2 | test-group | NULL | {"processing.copyAttributes": "io11,io12,io13,io14,io15,io16,io17,io18,io21,io22,io23,io24,io25,tempCalculated"} |
As in the configuration
<entry key='processing.copyAttributes.enable'>true</entry>
<entry key="processing.copyAttributes">io11,io12,io13,io14,io15,io16,io17,io18,io21,io22,io23,io24,io25</entry>
<entry key='processing.computedAttributes.enable'>true</entry>
<entry key='processing.computedAttributes.deviceAttributes.enable'>true</entry>
Most likely copying tempCalculated
is causing this issue. You should not have multiple computed attributes depending on each other. They can be executed in a random order, so it's very unreliable setup. Combine all the logic into one attribute.
Hello everyone,
just to confirm:
I removed all dependencies, triggers, alarms.
I used one attribute, different for each device in which I added all the alarm logic.
R_A.TC-00 Alarm Temperature
alarm
io11 ? (io11 <= -30.00) && (io11 >= -40.9) ? (io11 - 5) < io21 ? 'temperature' : (io11 - 5) > io22 ? 'temperature' : null : ((io11 <= -41.00) && (io11 >= -65.9)) ? (io11 - 6) < io21 ? 'temperature' : (io11 - 6) > io22 ? 'temperature' : null : io11 < 21 || io11 > io22 ? 'temperature' : null : null
I left tempCalculated as a separate attribute that I use for the templates.
Now I think everything works as expected.
Hello again,
I have a question regarding the launch of a notification.
After updating to version 5.4, I noticed something I don't know if I should expect.
The trigger that raises an alarm is io11 < io21 (-66.6 < -60.00)
As can be seen in the tables below.
The new position value arrives in the email notification
Here is the data: