Computed attributes not working all the time

maclofin5 months ago

I'm not sure if I'm bad or what but I have this computed attribute.

event == "42" ? "accident" : null

Screenshot 2024-07-14 031013.png

but when the event arrived to the server, it doesn't show any notification neither in reports.

Screenshot 2024-07-14 031141.png

the computed attribute is linked with my device, the notification is enable for web/firebase (the test work) for the alarm "accident", checked the logs and don't throw anything.

this is startek, startek event in impact is 42. but isn't in the source code (I downloaded the latest to check and don't work in native way)

Anton Tananaev5 months ago

Why are you comparing it to a string, not a number? In the attributes it's a number.

maclofin5 months ago

Thanks, it seems to work now!, I have another question, how can I know though API which device is linked to a user. If I request all users, only comes the users informations without deviceId attached, if I request the devices, only the info of the devices without user linked. I'm trying to send userId in the event or userId and attributes but I can't.

Anton Tananaev5 months ago

You can check what the official app does.

maclofin5 months ago

I don't find anything, for example the idea is that with the event forwarded I could modify or read user attributes to make action in a webhook, but only with the forwarder event I cannot see of who is this device even if I have access to server though admin API.