rgtre


Getting Started with Smartylighting Streetlights API

What this API Does and Why it's Useful

The Smartylighting Streetlights API empowers you to remotely manage and monitor city streetlights. This powerful tool allows for efficient urban lighting control and real-time environmental insights. Imagine being able to:

  • Turn a specific streetlight on or off 🌃 with a simple command.
  • Dim a specific streetlight 😎 to conserve energy or adjust to ambient conditions.
  • Receive real-time information about environmental lighting conditions 📈, enabling adaptive lighting strategies and data-driven decisions.

This API is invaluable for smart city initiatives, energy management, and enhancing public safety and comfort through intelligent lighting infrastructure.

Prerequisites

To begin using the Smartylighting Streetlights API, you will need the following:

  • Kafka Client Library: This API communicates over Kafka. You'll need a Kafka client library compatible with your chosen programming language (e.g., confluent-kafka-python for Python, kafka-clients for Java, node-rdkafka for Node.js).
  • Kafka Broker Access: You'll need access to a Kafka broker. Our test broker is available at test.mykafkacluster.org:8092.
  • Authentication Credentials: For secure communication, you'll need SASL/SCRAM credentials (username and password) to authenticate with the Kafka broker.

Resources and Capabilities

The Smartylighting Streetlights API provides the following resources and capabilities:

Resource/TopicDescriptionCapabilities
smartylighting.streetlights.1.0.event.{streetlightId}.lighting.measuredThis topic is used for publishing real-time environmental lighting conditions from a specific streetlight.
  • Publish: Inform about environmental lighting conditions (receiveLightMeasurement).
smartylighting.streetlights.1.0.action.{streetlightId}.turn.onThis topic is used to send commands to turn on a specific streetlight.
  • Subscribe: Command a streetlight to turn on (turnOn).
smartylighting.streetlights.1.0.action.{streetlightId}.turn.offThis topic is used to send commands to turn off a specific streetlight.
  • Subscribe: Command a streetlight to turn off (turnOff).
smartylighting.streetlights.1.0.action.{streetlightId}.dimThis topic is used to send commands to dim a specific streetlight.
  • Subscribe: Command a streetlight to dim (dimLight).

Authentication

Access to the Smartylighting Streetlights API is secured using SASL/SCRAM authentication. This means you will need to provide a username and password to connect to the Kafka broker.

When configuring your Kafka client, ensure you set up the SASL mechanism to SCRAM-SHA-256 (or SCRAM-SHA-512 if supported by your broker) and provide your assigned username and password.

Example (conceptual, specific implementation depends on your Kafka client library):

Please contact support to obtain your authentication credentials if you do not already have them.