You can create a computed attribute that would set alarm attribute based on the power value.
Yes, I thought so too, but that's where it goes wrong.
I'm trying to learn to make those attributes, but I did not quite succeed yet ...
We have documentation for it and there are some forum examples. If it still doesn't work, post details on what you've tried.
Have studied the documentation and have tried to make a text string based on it
power? power <10: null
I then get an error message:
class java.lang.Boolean cannot be cast to class java.lang.Number (java.lang.Boolean and java.lang.Number are in module java.base of loader 'bootstrap') - ClassCastException (AttributeResource:61 < ...)
And what is the type?
Where is the alarm and alarm type in your attempt?
Have tried with power and then I get the error when I test it on a device.
Have now tried with the type Alarm and there I do not get an error message. Will it work?
You probably need professional help with this. Looks like you don't understand what computed attributes are and how they work. And it doesn't seem like you are interested in putting any effort to research it yourself.
yes i need help therefore i am writing here. that's right.
However, I am very interested in learning it!
I just need to find someone who has the skills to teach me that and it does not look like you have or want to.
Yeah, that's a bit out of scope for what I help with on this forum. I help people who did their research and just need a small hint to point them in the right direction.
Anyway, hopefully there's someone who can and willing to teach you here.
Create Computed Attribute - add any description - I made my Attribute selection as Alarm
Expression is as below where power is an attribute actively reported by the device to traccar
power <10 ? true : null
Type is String
Click on test with a device - change the voltage setting to force expected output and to not - save and add to the device.
Alarm will be ACTIVE when power is <10 and not active when power >10
Looks like you are returning boolean value for a string type. It should be something like this:
power < 10 ? "lowPower" : null
True but works - see what I did there...hopefully Alf gets the hint - he was very close.
Hi visiondrive
Thanks for the example you have made now I have something to work with. yes also thanks to you Anton. I want to see if I can make it work otherwise I will return. Thanks
Hi there
I am trying to make so I get an email when there is less than 10 volts on the battery in the car, but can not make it work.
Anyone know how to set it up in Traccar ???