Hello All,
How to configure alarm on derived property as in AMU, as only properties displayed while alarm configuration, is the property configured during AMU configuration?
For example, I have created a new property in ThingShape which is added in Asset Thing Template, and I am setting value in it using subscription and want to create Alarm on that value, is there any OOTB solution in AMU.
Solved! Go to Solution.
Hi Javed
It's important to understand the alarming process. First, we have to configure the alarm in the Configuration -> Alarms screen. This forces us to select an attribute. And, as a reminder, attributes have corresponding properties of the same name in Composer : if there's an attribute called Temperature, you should also have a property called Temperature on that Thing in Composer. Second, the alarm service checks all values received in the Valuestream for the properties and checks those values' corresponding attributes' alarm conditions.
The official way to configure the attributes is to either :
- Create the attribute in the Configuration -> Equipment screen, in the Attributes tab. It forces you to select a tag.
- Import the attributes via the Excel import, then go in Composer to set the tag on the corresponding property.
The way it works in the supported method is : because the property has the Log setting, all its tag values are automatically saved into the Valuestream. But because we won't be using tags here, we can't use this method. Although it's not 100% out of the box and requires a bit of customization, there's an easy workaround to use values that come from elsewhere than a tag. You can create the attribute in either of the 2 methods described above, but remove (or don't set) the tag in Composer. After that, you will need to find a way to push values in the Valuestream of the property. If the value is coming from another property, I think just changing the property to be locally bound (instead of remotely bound) and selecting a property will work in most situations. If the value comes from elsewhere, like code inside a service or subscription, then you need to write code to send the value in the Valuestream. Here is an example taken from the RTPPM model documentation (subscriptions) :
me.AddStringValueStreamEntry({
timestamp: new Date(),
propertyName: 'Temperature',
value: ENTER_VALUE_HERE
});
Note that this will work for the alarm system. But if you want to also see the value in the asset card (Asset Monitoring Dashboard), this piece works differently. The values you see in the screen are simply the current values of properties AMUAttributeXValue_MCC, where X is the number in the card (1 to 9). So you would need to find a way to set the current value of those properties, in most cases it should be as simple as doing
me.AMUAttribute1Value_MCC = ENTER_VALUE_HERE;
Take a look - "AMU Alarm Scenarios": https://support.ptc.com/help/thingworx_applications/r9.6/en/index.html#page/thingworx_applications/user_interface/AMU_Alarm_scenarios.html
Hello @VladimirN ,
The above-mentioned guide talks about the timestamp scenario for value received.
In my case I am looking to configure an Alarm on a derived property.
Hi Javed
It's important to understand the alarming process. First, we have to configure the alarm in the Configuration -> Alarms screen. This forces us to select an attribute. And, as a reminder, attributes have corresponding properties of the same name in Composer : if there's an attribute called Temperature, you should also have a property called Temperature on that Thing in Composer. Second, the alarm service checks all values received in the Valuestream for the properties and checks those values' corresponding attributes' alarm conditions.
The official way to configure the attributes is to either :
- Create the attribute in the Configuration -> Equipment screen, in the Attributes tab. It forces you to select a tag.
- Import the attributes via the Excel import, then go in Composer to set the tag on the corresponding property.
The way it works in the supported method is : because the property has the Log setting, all its tag values are automatically saved into the Valuestream. But because we won't be using tags here, we can't use this method. Although it's not 100% out of the box and requires a bit of customization, there's an easy workaround to use values that come from elsewhere than a tag. You can create the attribute in either of the 2 methods described above, but remove (or don't set) the tag in Composer. After that, you will need to find a way to push values in the Valuestream of the property. If the value is coming from another property, I think just changing the property to be locally bound (instead of remotely bound) and selecting a property will work in most situations. If the value comes from elsewhere, like code inside a service or subscription, then you need to write code to send the value in the Valuestream. Here is an example taken from the RTPPM model documentation (subscriptions) :
me.AddStringValueStreamEntry({
timestamp: new Date(),
propertyName: 'Temperature',
value: ENTER_VALUE_HERE
});
Note that this will work for the alarm system. But if you want to also see the value in the asset card (Asset Monitoring Dashboard), this piece works differently. The values you see in the screen are simply the current values of properties AMUAttributeXValue_MCC, where X is the number in the card (1 to 9). So you would need to find a way to set the current value of those properties, in most cases it should be as simple as doing
me.AMUAttribute1Value_MCC = ENTER_VALUE_HERE;