Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

For example and simplicity let’s assume our Car Counter project contains has only one parking zone 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

Table of Contents

Parking Hierarchy registration

...

Optional: Virtual sensors creating

Since we explaining how to start using Car Counters, we decided, that it would be correct to explain how to start using Car Counters while you do not have Car Counters yetFor API testing purposes it always easier to start with virtual sensors.

Open Main Menu

...

Go to Device Management → Virtual Devices page

...

(thumbs up) You has finished Car Counter hierarhy registration if you see the following message

...

Car Counter area

...

configuration

Parking equipped by Car Counter require some specific operations:

...

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

Capacity Configuration

...

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

...

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

Code Block
languagebash
curl --location --request GET 'https://api.nwave.io/car_counters/v1/group/1234/capacity' --header 'X-Auth-Token: XXXXXXXXXXX'
Code Block
languagebash
curl --location --request PUT 'https://api.nwave.io/car_counters/v1/group/1234/capacity' --header 'X-Auth-Token: XXXXXXXXXXX' --header 'Content-Type: application/json' --data-raw '{"capacity":99}'

Occupancy Correction

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

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

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

Code Block
languagebash
curl --location --request GET 'https://api.nwave.io/car_counters/v1/group/1234/occupancy' --header 'X-Auth-Token: XXXXXXXXXXX'
Code Block
languagebash
curl --location --request PUT 'https://api.nwave.io/car_counters/v1/group/2923/occupancy' --header 'X-Auth-Token: XXXXXXXXXXX' --header 'Content-Type: application/json' --data-raw '{"occupied":3}'

Manual Testing

Virtual Car Counters

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

...