Back to Studioiot.hovahdigitalsolutions.com
API & Hardware Documentation

How to Connect Your Hardware to Kiyp

One device_token powers HTTP REST, MQTT, and WebSocket simultaneously on the exact same virtual pins (V0, V1, V2...).

ESP32 / S3 / C3• Arduino C++NodeMCU / ESP8266• Arduino C++Arduino Uno R4 WiFi• Arduino C++STM32 (Nucleo / Blue Pill)• STM32duino C++BBC micro:bit• MicroPythonRaspberry Pi Pico W• MicroPythonRaspberry Pi 4 / 5 / Zero 2 W• Python 3
1

Prompt or Drag Widgets

Generate a project in AI Prompt or drag 15+ Blynk-style widgets in Widgets & Canvas.

2

Copy Your device_token

Open the 'API, Code & Simulator' drawer in the top-right and copy your device_token.

3

Send Data / Flash ESP32

Test first with the built-in Simulator or cURL, then flash Arduino C++ or MicroPython.

1. HTTP REST API

Simplest protocol for ESP32 (HTTPClient), Raspberry Pi Pico W (urequests), and cURL testing.

POST /v1/telemetry — Send Sensor Readings
curl -X POST https://iot.hovahdigitalsolutions.com/v1/telemetry \
  -H "Authorization: Bearer <YOUR_DEVICE_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"V0": 42.5, "V1": 1}'
GET /v1/state — Poll Dashboard Switches & Sliders
curl -X GET "https://iot.hovahdigitalsolutions.com/v1/state?pins=V0,V1" \
  -H "Authorization: Bearer <YOUR_DEVICE_TOKEN>"
ESP32 Arduino C++ (HTTPClient.h)
#include <WiFi.h>
#include <HTTPClient.h>

const char* WIFI_SSID    = "YOUR_WIFI";
const char* WIFI_PASS    = "YOUR_PASSWORD";
const char* KIYP_URL  = "https://iot.hovahdigitalsolutions.com/v1/telemetry";
const char* DEVICE_TOKEN = "<YOUR_DEVICE_TOKEN>";

void loop() {
  HTTPClient http;
  http.begin(KIYP_URL);
  http.addHeader("Content-Type", "application/json");
  http.addHeader("Authorization", String("Bearer ") + DEVICE_TOKEN);
  http.POST("{\"V0\": 31.4, \"V1\": 72}");
  http.end();
  delay(5000);
}

2. Embedded MQTT Broker (Real-Time)

Ideal for instant relay/siren control (downlink) and automatic online/offline presence (LWT).

MQTT Credentials & Topics
Broker Host : iot.hovahdigitalsolutions.com
TCP Port    : 1883
WSS Port    : 8883
Username    : kiyp
Password    : <YOUR_DEVICE_TOKEN>

# Uplink (Device -> Cloud)
kiyp/{device_id}/up/V0       # payload: 42.5 or {"value": 42.5}

# Downlink (Dashboard Switch/Slider -> Device)
kiyp/{device_id}/down/V2     # payload: 1 or 0

# Presence LWT
kiyp/{device_id}/status      # payload: online | offline

3. WebSocket Live Hub

Stream live pin updates to web browsers or custom apps.

JavaScript WebSocket Client
const ws = new WebSocket(
  "wss://iot.hovahdigitalsolutions.com/v1/ws?project_id=<PROJECT_ID>&token=<SUPABASE_JWT>"
);

// Receive live sensor updates
ws.onmessage = (event) => {
  const frame = JSON.parse(event.data);
  // frame.type: "datastream_update" | "device_status" | "alert_triggered"
  console.log(frame);
};

// Send control command from UI -> MQTT downlink
ws.send(JSON.stringify({ type: "set_pin", pin: "V2", value: true }));

4. Telegram Alerts & Pin-to-Pin Automations

Receive MYT (UTC+8) alerts in Telegram or automatically trigger relays when thresholds cross.

Telegram Bot Setup:

  1. Open Telegram, message @BotFather, and run /newbot to get your Bot Token.
  2. Message @userinfobot (or your group) to get your numeric Chat ID.
  3. In Kiyp → 'API, Code & Simulator' → 'Rules & Alerts' tab, enter your Bot Token + Chat ID and threshold (e.g., V0 > 150).
Kiyp • Connect in a blink. Predict with AI. — by Hovah Digital SolutionsOpen Widgets & Canvas →