1

Question regarding adding units to sessions for getting events

Тема: Question regarding adding units to sessions for getting events

Hello Wialon team, I am currently adding units to my session via-

svc=events/update_units&params={"mode":"add",
                "units":[
                        {
                        "id":<long>,
                        "detect":
                            {
                                "trips":<uint>,
                                "lls":<uint>,
                                "sensors":<uint>,
                                "ignition":<uint>,
                                "counters":<uint>,
                                "speedings":<uint>,
                            }
                        },
                        ...
                ]}

My question is if there any way to select all my units en masse without needed to specific them individually. Similar to how I use

detect":{"*":0}

to select all sensors, is there any similar value I can use to get all my units? Thanks.

2

Question regarding adding units to sessions for getting events

Re: Question regarding adding units to sessions for getting events

Omar Salem hello, in order to pass all units you need to pass their IDs, there is no option to pass all units with special symbol like asterisk. As "units" parameter value type is an array, you can pass the units in one request, for example.:
svc=events/update_units&params={"mode":"add","units":[{"id":11111,"detect":{"sensors":0,"counters":0}},{"id":22222,"detect":{"sensors":0,"counters":0}}]}&sid=

Anton Zinovyev
Technical Care Engineer (L2)
Wialon
3

Question regarding adding units to sessions for getting events

Re: Question regarding adding units to sessions for getting events

Thank you for the clarification @zant. My main concern is that this will add a manual component in my data stream which will make future maintenance cumbersome. Can you advise on potential solutions to address this? I had success querying my units using core/search_items with the from: and to: parameters however it is not ideal for getting sensor data.

4

Question regarding adding units to sessions for getting events

Re: Question regarding adding units to sessions for getting events

Omar Salem Hello. Unfortunately, there is no other option in our documentation rather than adding all units in events with IDs indication.
Another solution is to use reports with the Sensor tracing table type by Units group. You can enable option 'Skip invalid values' in the table settings. But, please, note that there are several limitation that can affect report execution for a large amount of units. The list you can find here -- https://sdk.wialon.com/wiki/en/sidebar/ … or_reports

Anton Zinovyev
Technical Care Engineer (L2)
Wialon