Car Counters Getting Started

This tutorial explains how to set up a simple Car Counter project from scratch and get occupancy data via REST API.

For example and simplicity let’s assume our Car Counter project has only one parking lot with one entrance and one exit. We will need to create the following object “tree” (hierarchy):

  • Project: Example Project

    • Zone: Example Zone

      • Group: Example Group

        • Position 1: Entrance

        • Position 2: Exit

Parking Hierarchy registration

Project registration

Open Main Menu

Go to Settings → Projects page

Press button

Enter the new Project Name, Timezone, and press ADD

Zone registration

Open Main Menu

Go to Device Management → Zones page

Press button

Enter the Zone name, select Project, and press SAVE

Group registration

After zone registration, you can see the Zone page. Go to the GROUPS tab

Press button

Enter Group Name, select Group Type → Standalone Car Counters, optionally enter Custom ID and press SAVE

You have registered the parking project structure. The next step is device positioning.

Optional: Virtual sensors creating

For API testing purposes it is always easier to start with virtual sensors.

Open Main Menu

Go to Device Management → Virtual Devices page

Press button

Enter Firmware → CC basic UK B1/1.11.5, Number of devices → 2, turn on Active switcher and press ADD.

Device positioning

Positioning in Splace. Direction configuration in d.nwave.io

Positioning

Sign in https://splace.nwave.io with login and password for https://d.nwave.io.

You can use mobile application Splace instead of https://splace.nwave.io

Press the Action button and click on the top button in the dropped-out list

On the tab GROUP OF DEVICES select Project, Zone, Group and enter the number of positioning devices, then press the button SET POSITIONS

Locate the central marker on your parking position, then press OK

Now you can see green text START POINT in the bottom left. You can just press OK in the second time to proceed

Now you can see that the text FINISH POINT has become green too. Press the OK button to proceed

If you see an error and FINISH POINT still has red color, try to go to the application settings page and disable option “Interval placing”.

Enter positioning device IDs and press the button CREATE AND BIND. If you followed the instructions in the previous chapter, you should insert the IDs of created virtual devices. If you are positioning real devices, enter their IDs.

If you see an error about incompatibbility of device firmware type and group type, check if group has type Standalone Car Counter and device firmware has prefix “CC”

You has finished Car Counter hierarchy registration if you see the following message

Direction configuration

Sign in https://d.nwave.io.

Open the main menu and go to page Device Management → Positions.

Open the filter panel in the right top

Select filters by Project/Zone/Group to filter your installed devices

Click on the position ID of one of the positioned devices

Scroll down the Position page and click on the button “EDIT LABELS”

Select the label IN or OUT for position on the entrance or exit from parking.

Configure labels for all installed devices.

The first counter message after the label configuration will not change zone/group occupancy because it will be interpreted as starting point.

Device positioning and direction configuration in Splace

You can do both actions in the Splace app, but only in the case of positioning sensors one by one.

Go to https://splace.nwave.io

Open the drop-down button list and click on the top button:

Go to tab BIND DEVICE

Select Project, Zone, and Group; enter Device ID; select label IN for entrance or OUT for exit from the zone.

Click on the BIND button.

Choose the device location on the map and press the OK button

After that, you will see the message Device has been bound successfully. Now your device is ready to use.

The first counter message after the label configuration will not change zone/group occupancy because it will be interpreted as starting point.

Car Counter area configuration

Parking equipped by Car Counter requires some specific operations:

  • configuration of entrances, exits, transitions

  • configuration of groups capacity

  • setting up current group occupancy

Configuration of entrances, exists, transitions and group capacity is a one-off operation in most cases. You should provide us with information in the format presented below:

Project: “Example Project”

Zone: “Example Zone”

Group “Example Group” capacity: 300

Sensor 1FD02, Group “Example Group”, Direction: IN

Sensor 1FDCA, Group “Example Group”, Direction: OUT

After receiving this data, we will make the needed configuration in the next 24h.

Also, we can correct current group occupancy operatively if you notify us about your need for this action at least 24h before.

Configuration using parking analytics site

The parking analytics site provides an interface for simple configuration of car counter zone capacity and occupancy. If the zone contains more than one car counter group, you should configure each group using API. Configuration using API is described in the next chapter.

Preliminary steps

Before setting up your car counter zone occupancy and capacity you should follow a few steps:

  1. Go to site analytics.nwave.io

  2. Click on the main menu button

     

  3. Select the Car Counter page

     

  4. Open the FILTERS panel

     

  5. Select Project and Zone to be configured and press button SAVE

Capacity configuration

After doing the preliminary steps, you are able to set up the capacity of your car counter zone. To do that, you need to click on the pen icon on the right of “CAPACITY”:

Fill in the capacity value and press the button SAVE:

Now you can see, that capacity is successfully set

Occupancy configuration

After doing the preliminary steps, you can set up the capacity of your car counter zone. To do that, you need to click on the pen icon on the right of “OCCUPANCY”:

If you are going to set the current occupancy, it is enough to fill in the occupancy value and press the button SAVE

If you noticed that occupancy has been changed after counting or you want to correct occupancy in the past, you can choose the time of occupancy correction:

  1. Fill in the occupancy value

  2. Enable occupancy correction in the past

  3. Select the date and time of occupancy counting
    Please, select the date and time carefully. Corrections for the time earlier than the last made correction are prohibited.

  4. Press the button SAVE

Check occupancy changes applied

Configuration using API

Capacity Configuration

Capacity can be configured only for groups. You should go to the page of the group you created earlier and find the group ID

Now you are able to get and set the group capacity. The following examples get the capacity of the group with ID 1234 and set capacity to 99 spaces:

curl --location --request GET 'https://api.nwave.io/car_counters/v1/group/1234/capacity' --header 'X-Auth-Token: XXXXXXXXXXX'

Occupancy Correction

Occupancy correction is needed periodically or after technical maintenance. The Nwave cloud calculates occupancy for all levels of the hierarchy based on group occupancy, so all occupancy correction operations are possible only with groups.

You can find how to get a group ID in the previous chapter.

The following examples show how to get current occupancy for group 1234 and how to set it:

curl --location --request GET 'https://api.nwave.io/car_counters/v1/group/1234/occupancy' --header 'X-Auth-Token: XXXXXXXXXXX'

Entrances and Exits Configuration

You have to mark a position by label IN or OUT to make it entrance or exit for car counter group.

  1. Go to a car counter group page

  2. Click on the tab POSITIONS

  3. Click on Device ID positioned on Exit

  4. Click on “EDIT LABELS”

  5. Mark label OUT in the list and press the button SAVE

     

Done, the position is configured as the exit from the group. Now repeat the same actions with device 1FD02 and set the label IN for setting it as the entrance to the group.

Manual Testing

Virtual Car Counters

Virtual Car Counters allows you to set counter value that you want and when you want.

To do this, go to Device Management → Virtual Devices page, find the virtual device in the list, and press the button SEND MESSAGE

Enter a new counter value and press SEND

The message has been sent, you can check this by pressing on button VIEW MESSAGES

Requesting occupancy data

First of all, you have to create Authorization Token to get access to Nwave API.

This document completely describes the process of Authorization Tokens creation: Generating Authorization Tokens

Now, you should get to know the ID of the created zone. For this you have to go to Device Management → Zones, find your zone in the list, and press on the zone name.

Zone ID is demonstrated on the top of the Zone page

The next step is getting data. You can read about API here: Car Counters Analytics API | Realtime Occupancy Summary API

In this tutorial, we show only how to get the zone’s current occupancy. Use the following snippet. You should replace zone_id and X-Auth-Token values before running.

curl --request GET 'https://api.nwave.io/analytics/v1/car_counters/realtime/occupancy_summary?group_by=zone&zone_id=111' --header 'x-Auth-Token: XXXXXXXXXXXX'

Done! You have just created Car Counters Parking Project and got data about its occupancy. You can find more data about analytics API features on the special documentation page