Custom Attribute mail notification

adrianr 4 years ago

GPS device has some light tamper module, in the left panel i have the attribute named : Illuminance, its value changes from 0 to 6 or more, when 0 to 1 the gps is ok, if higher than 1 means the gps either fall off or someone removed it.
Anyway, how and where can i insert that value to get email notification. i searched the forums for this but cant find a proper solution.

What i did so far, created a computed attribute with Description: LightTamper, Attribute: alarm, expression: if (Illuminance <=1.0 && Illuminance >=0.1) { null; } else {'GPS lost or disconnected from the car';} , type: string

thank you

Anton Tananaev 4 years ago

You have to use an alarm attribute to generate an event and notification.

adrianr 4 years ago

i have generated an alarm, but the type of alarms i can select are predefined, tried tamper, vibration, etc
i think im missing some info

Anton Tananaev 4 years ago

You can either use tampering or removing alarm.

adrianr 4 years ago

tried both, no results.
i dont see how computed attributes are linked to attributes in notification, but here is an image of what my device reports in attribute interface

https://ibb.co/PxCxXGH

the value is 0.41, that means its under the car, if the value goes up, like over 1, means someone disconnected the magnets or device fall off somehow, its a tamper/tilt based on a light sensor, because the sensor is on the magnets part of the device, when sticked to some metal the light sensor illuminance value is almost at 0.03

Anton Tananaev 4 years ago

Your computed attribute expression is incorrect. First of all, the attribute should be lower-camel-case. Secondly, I don't think the syntax is correct. Please make sure you read all the relevant documentation and test your expression before requesting further help.

adrianr 4 years ago

solved, i got the expression and seems ok, still testing, if everything is ok ill write down the steps

Zeeshan Hameed 2 years ago

Hi Adrianr, Had you resolved the Light Tamper expression issue? If yes, can you please add here expression and steps to test light/illuminance. Thanks

adrianr 2 years ago

hi

created a computed attribute, set the attribute to Alarm, expression if (illuminance <= 1) { null; } else {'tampering';}, type string, then i created a notification type Alarm, all devices, Alarms: selected the tampering one created above, channels: mail