Centralized system on several ESP8266's.
Nothing works yet, but you can try it here ¯\(ツ)/¯
Tries to find devices in local network
{
"status": "success",
"data": [
{
"check_word": "lamp",
"ip": "192.168.1.100",
"mac": "01:23:45:67:89:ab"
},
{
"check_word": "garland",
"ip": "192.168.1.123",
"mac": "10:32:54:76:98:ba"
}
]
}
Add new device to the list and return id
{
"ip": "192.168.1.100"
}
{
"status": "success",
"status_code": "200",
"slave_version":"1.0.0",
"data": {
"id": "2",
"mac": "01:23:45:67:89:0a",
"code_word": "bacon pancakes"
}
}
{
"status": "error",
"status_code": "device didn't respond"
}
Remove device from list & delete all dependencies on it
{
"id": 2
}
{
"status": "success"
}
{
"status": "error",
"description": "no such id"
}
Get an array of UI Elements
{
"status": "success",
"data": [
{
"title": "Lamp",
"type": "power-switch",
"connections": [
"bedroom-lamp-state"
]
}
]
}
Set an array of UI Elements
[
{
"title": "Lamp",
"type": "power-switch",
"connections": [
"bedroom-lamp-state"
]
}
]
{
"status": "success"
}
{
"status": "error",
"description": "unknown type"
}
Get an array of all known devices
{
"status": "success",
"data": [
{
"id": 0,
"mac": "01:23:45:67:89:ab",
"title": "Light sensor in bedroom",
"class": "sensor",
"inputs": [],
"outputs": [
{
"name": "brightness",
"to": "bedroom-light-level"
}
]
},
{
"id": 1,
"mac": "12:34:56:78:90:cd",
"title": "Lamp in bedroom",
"class": "light",
"inputs": [
{
"name": "on",
"from": "bedroom-lamp-state"
}
],
"outputs": [
{
"name": "on",
"to": "bedroom-lamp-state"
}
]
}
]
}
Edit device data except mac-address
{
"id": 2,
"title": "Light sensor in bedroom",
"class": "sensor",
"inputs": [],
"outputs: [
{
"name": "brightness",
"to": "bedroom-light-level"
}
]
}
{
"status": "success"
}
{
"status": "error",
"description": "no such id"
}
Get one device data
{
"id": 2
}
{
"status": "success",
"data": {
"id": 1,
"mac": "12:34:56:78:90:cd",
"title": "Lamp in bedroom",
"class": "light",
"inputs": [
{
"name": "on",
"from": "bedroom-lamp-state"
}
],
"outputs": [
{
"name": "on",
"to": "bedroom-lamp-state"
}
]
}
}
{
"status": "error",
"description": "no such id"
}
Get an array of all global variables
[
{
"name": "bedroom-light-level",
"from": {
"id": 0,
"output": "brighness"
}
},
{
"name": "bedroom-lamp-state",
"from": {
"id": 1,
"output": "on"
},
"to": {
"id": 1,
"input": "on"
}
}
]
Get an object with global var`s values
{
"bedroom-lamp-state": 0,
"bedroom-light-level": 0
}
Add new variable to list
{
"name": "qwerty"
}
{
"status": "success"
}
{
"status": "error",
"description": "already exists"
}
Delete variable & all its connections
{
"name": "qwerty"
}
{
"status": "success"
}
{
"status": "error",
"description": "no such var"
}
Change variable value
{
"name": "qwerty",
"value": 0.19
}
{
"status": "success"
}
{
"status": "error",
"description": "invalid variable name"
}