rrrrrrrrrrr
Getting Started with the Smartylighting Streetlights API
Introduction to the Smartylighting Streetlights API
Welcome, API developers! This page is designed to help you quickly understand and integrate with the Smartylighting Streetlights API. Our API empowers you to remotely manage and monitor city streetlights, bringing smart city capabilities to your applications.
With this API, you can:
- Turn a specific streetlight on/off 🌃: Gain direct control over individual streetlights, allowing for efficient energy management and responsive city services.
- Dim a specific streetlight 😎: Adjust the brightness of streetlights to optimize lighting conditions based on time of day, weather, or specific events, further enhancing energy savings and citizen comfort.
- Receive real-time information about environmental lighting conditions 📈: Access live data on light measurements from streetlights, enabling dynamic adjustments and data-driven insights into urban lighting environments.
This API is incredibly useful for developing applications that aim to:
- Automate city lighting schedules.
- Respond to real-time environmental changes.
- Improve public safety and energy efficiency.
- Integrate with broader smart city initiatives.
We're excited to see what you'll build!
Prerequisites
To begin using the Smartylighting Streetlights API, you'll need the following:
- Kafka Client Library: Since this is a Kafka-based API, you'll need a Kafka client library compatible with your chosen programming language (e.g.,
confluent-kafka-pythonfor Python,kafka-clientsfor Java,node-rdkafkafor Node.js). - Access to a Kafka Broker: 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 authentication credentials (username and password).
Resources and Capabilities
The Smartylighting Streetlights API provides access to various resources and capabilities through Kafka topics. Below is a summary of the key operations you can perform:
| Resource/Topic | Capability | Description | Message Type |
|---|---|---|---|
smartylighting.streetlights.1.0.event.{streetlightId}.lighting.measured | Receive Light Measurement | Inform about environmental lighting conditions of a particular streetlight. This is a publish operation, meaning your application will consume messages from this topic. | lightMeasured |
smartylighting.streetlights.1.0.action.{streetlightId}.turn.on | Turn On | Command a particular streetlight to turn the lights on. This is a subscribe operation, meaning your application will produce messages to this topic. | turnOnOff |
smartylighting.streetlights.1.0.action.{streetlightId}.turn.off | Turn Off | Command a particular streetlight to turn the lights off. This is a subscribe operation, meaning your application will produce messages to this topic. | turnOnOff |
smartylighting.streetlights.1.0.action.{streetlightId}.dim | Dim Light | Command a particular streetlight to dim the lights. This is a subscribe operation, meaning your application will produce messages to this topic. | dimLight |
Message Details
Here's a quick overview of the message payloads:
lightMeasured:lumens(integer): Light intensity measured in lumens.sentAt(string, date-time): Date and time when the message was sent.
turnOnOff:command(boolean): Whether to turn on (true) or off (false) the light.sentAt(string, date-time): Date and time when the message was sent.
dimLight:percentage(integer): Percentage to which the light should be dimmed (0-100).sentAt(string, date-time): Date and time when the message was sent.
Authentication
The Smartylighting Streetlights API uses SASL/SCRAM for secure authentication with the Kafka broker.
To authenticate your application, you will need to provide your assigned username and password. When configuring your Kafka client, ensure you set the appropriate SASL mechanism and provide these credentials.
Example (conceptual, specific implementation depends on your Kafka client library):
Please replace YOUR_USERNAME and YOUR_PASSWORD with the credentials provided to you.
Next Steps
Now that you have a foundational understanding of the Smartylighting Streetlights API, you're ready to start coding! Refer to the detailed API reference for specific message formats and examples. If you encounter any issues or have questions, don't hesitate to reach out to our support team.
Happy coding!