Skip to content

Files

Latest commit

26d4052 · Jun 10, 2024

History

History
78 lines (48 loc) · 3.57 KB

README.md

File metadata and controls

78 lines (48 loc) · 3.57 KB

Smart Home - (command)(mqtt)

This Arduino sketch allows you to control your device through the Anedya.

Warning

This code is for hobbyists for learning purposes. Not recommended for production use!!

Set-Up Project in Anedya Dashboard

Following steps ouline the overall steps to setup a project. You can read more about the steps here

  1. Create account and login
  2. Create new project.
  3. Create a node (e.g., for home- Room1 or study room).

Tip

For more details, Visit anedya documentation

Hardware Set-Up

  • Connect Led at GPIO pin 5(Marked D1 on the nodeMCU)

Code Set-Up

  1. Replace <PHYSICAL-DEVICE-UUID> with your 128-bit UUID of the physical device.
  2. Replace <CONNECTION-KEY> with your connection key, which you can obtain from the node description.
  3. Set up your WiFi credentials by replacing SSID and PASSWORD with your WiFi network's SSID and password.

Dependencies

ArduinoJson

This repository contains the ArduinoJson library, which provides efficient JSON parsing and generation for Arduino and other embedded systems. It allows you to easily serialize and deserialize JSON data, making it ideal for IoT projects, data logging, and more.

  1. Open the Arduino IDE.
  2. Go to Sketch > Include Library > Manage Libraries....
  3. In the Library Manager, search for "ArduinoJson".
  4. Click on the ArduinoJson entry in the list.
  5. Click the "Install" button to install the library.
  6. Once installed, you can include the library in your Arduino sketches by adding #include <ArduinoJson.h> at the top of your sketch.

Timelib

The timelib.h library provides functionality for handling time-related operations in Arduino sketches. It allows you to work with time and date, enabling you to synchronize events, schedule tasks, and perform time-based calculations.

To include the timelib.h library:

  1. Open the Arduino IDE.
  2. Go to Sketch > Include Library > Manage Libraries....
  3. In the Library Manager, search for "Time".
  4. Click on the ArduinoJson entry in the list(Time by Michael Margolis).
  5. Click the "Install" button to install the library.
  6. Once installed, you can include the library in your Arduino sketches by adding #include <TimeLib.h> at the top of your sketch.

PubSubClient

This repository contains the PubSubClient library, which provides a simple interface to publish and subscribe to messages using the MQTT protocol. It is suitable for connecting Arduino devices to MQTT brokers, enabling efficient communication in IoT projects.

  1. Open the Arduino IDE.
  2. Go to Sketch > Include Library > Manage Libraries....
  3. In the Library Manager, search for "PubSubClient".
  4. Click on the PubSubClient entry in the list.(PubSubClient by nick-o-larry)
  5. Click the "Install" button to install the library.
  6. Once installed, you can include the library in your Arduino sketches by adding #include <PubSubClient.h> at the top of your sketch.

Tip

Looking for Python SDK? Visit PyPi or Github Repository

Tip

For more information, visit anedya.io