Expression seems valid, but your result won't be added to the total distance because it's calculated earlier.
So the totaldistance wont to be adjusted because it’s calculated first.
Then the logic would be:
!motion || !valid ?totaldistance=totaldistance+0
does it support without the ‘:’ (else) part?
Thanks
for the totalDistance attribute:
!motion || !valid ? totaldistance+0
You always need else part.
so it would be
!motion || !valid ? totaldistance+0: totaldistance+distance
Cmiiw
all previous records would not be adjusted?
or is there anyway to adjust them?
Thanks
There is no way to adjust old records.
Noted & thanks
Is there any option in server to apply these compute attributes to all devices rather than to apply it to one by one device?
You can apply to a group.
Hi,
I am trying compute attribute for distance, with criteria as below:
if motion = false or valid = false
then distance = 0
else
distance = distance * 1
does the syntax below is correct?
!motion || !valid? 0:distance*1
does it also impact to totalDistance? .. I meant.. the totalDistance should also added to the result value of compute attribute..
I only found compute attribute reference on:
https://www.traccar.org/documentation/computed-attributes/
where can I find complete reference for it?
thanks