forked from arendst/Tasmota
-
Notifications
You must be signed in to change notification settings - Fork 1
JSON Status Responses
RTurala edited this page Nov 29, 2018
·
1 revision
temp note: for now (6.0.0a) the statetext overwrites the json power result (e.g. "ON" => "AN" or any other statetext the users enter)
{
"Status": {
"Module": 1,
"FriendlyName": "XXX",
"Topic": "sonoff",
"ButtonTopic": "0",
"Power": 0,
"PowerOnState": 0,
"LedState": 1,
"SaveData": 0,
"SaveState": 1,
"ButtonRetain": 0,
"PowerRetain": 0
},
"StatusPRM": {
"Baudrate": 115200,
"GroupTopic": "sonoffs",
"OtaUrl": "XXX",
"Uptime": "1 02:33:26",
"Sleep": 150,
"BootCount": 32,
"SaveCount": 72,
"SaveAddress": "FB000"
},
"StatusFWR": {
"Version": "5.12.0a",
"BuildDateTime": "2018.02.11 16:15:40",
"Boot": 31,
"Core": "2_4_0",
"SDK": "2.1.0(deb1901)"
},
"StatusLOG": {
"SerialLog": 0,
"WebLog": 4,
"SysLog": 0,
"LogHost": "domus1",
"LogPort": 514,
"SSId1": "XXX",
"SSId2": "XXX",
"TelePeriod": 300,
"SetOption": "00000001"
},
"StatusMEM": {
"ProgramSize": 457,
"Free": 544,
"Heap": 23,
"ProgramFlashSize": 1024,
"FlashSize": 1024,
"FlashMode": 3
},
"StatusNET": {
"Hostname": "XXX",
"IPAddress": "192.168.178.XX",
"Gateway": "192.168.178.XX",
"Subnetmask": "255.255.255.XX",
"DNSServer": "192.168.178.XX",
"Mac": "2C:3A:E8:XX:XX:XX",
"Webserver": 2,
"WifiConfig": 4
},
"StatusTIM": {
"UTC": "Thu Feb 15 00:00:50 2018",
"Local": "Thu Feb 15 01:00:50 2018",
"StartDST": "Sun Mar 25 02:00:00 2018",
"EndDST": "Sun Oct 28 03:00:00 2018",
"Timezone": 1
},
"StatusSNS": {
"Time": "2018.02.15 01:00:50",
"Switch1": "OFF"
},
"StatusSTS": {
"Time": "2018.02.15 01:00:50",
"Uptime": "1 02:33:26",
"Vcc": 3.504,
"POWER": "OFF",
"Wifi": {
"AP": 1,
"SSId": "XXX",
"RSSI": 100,
"APMac": "34:31:C4:XX:XX:XX"
}
}
}
After StatusNET
"StatusMQT": {
"MqttHost": "192.168.XXX.XX",
"MqttPort": 1883,
"MqttClientMask": "DVES_%06X",
"MqttClient": "DVES_4AXXXX",
"MqttUser": "admin",
"MAX_PACKET_SIZE": 1000,
"KEEPALIVE": 15
},
idx, nvalue, svalue without array
..."StatusTIM": {
"UTC": "Thu Feb 01 20:29:40 2018",
"Local": "Thu Feb 01 21:29:40 2018",
"StartDST": "Sun Mar 25 02:00:00 2018",
"EndDST": "Sun Oct 28 03:00:00 2018",
"Timezone": 1
},
"idx": 286,
"nvalue": 0,
"svalue": "19.7",
"StatusSNS": {
"Time": "2018.02.01 21:29:40",
"DS18B20": {
"Temperature": 19.7
},
"TempUnit": "C"
},
"StatusSTS": { ...
After StatusTIM
"StatusPTH": {
"PowerLow": 0,
"PowerHigh": 0,
"VoltageLow": 0,
"VoltageHigh": 0,
"CurrentLow": 0,
"CurrentHigh": 0
},
"StatusSNS": {
"Time": "2018.02.04 23:17:01",
"ENERGY": {
"Total": 3.185,
"Yesterday": 3.058,
"Today": 0.127,
"Power": 0,
"Factor": 0.00,
"Voltage": 221,
"Current": 0.000
}
},
"StatusSNS": {
"Time": "2018.02.01 22:52:09",
"AM2301": {
"Temperature": 15.5,
"Humidity": 50.6
},
"TempUnit": "C"
},
{
"StatusSNS": {
"Time": "2018-02-10T22:46:34",
"BMP280": {
"Temperature": 80.9,
"Pressure": 984.4
}
}
}
"StatusSNS": {
"Time": "2018.02.01 22:48:39",
"DHT11": {
"Temperature": 12.0,
"Humidity": 42.0
},
"TempUnit": "C"
},
"StatusSNS": {
"Time": "2018.02.01 21:29:40",
"DS18B20": {
"Temperature": 19.7
},
"TempUnit": "C"
},
{
"StatusSNS": {
"Time": "2018-02-07T20:16:19",
"DHT11": {
"Temperature": 78.8,
"Humidity": 27.0
},
"SHT3X": {
"Temperature": 74.8,
"Humidity": 18.9
},
"TempUnit": "F"
}
}
"StatusSNS": {
"Time": "2018-02-16T16:18:49",
"Temperature": 25,
"Humidity": 83,
"Light": 10,
"Noise": 20,
"AirQuality": 100,
"TempUnit": "C"
},
"StatusSNS": {
"Time": "2018-02-16T16:22:12",
"HTU21": {
"Temperature": 24.7,
"Humidity": 32.1
},
"PMS5003": {
"CF1": 1,
"CF2.5": 2,
"CF10": 2,
"PM1": 1,
"PM2.5": 2,
"PM10": 2,
"PB0.3": 423,
"PB0.5": 116,
"PB1": 17,
"PB2.5": 1,
"PB5": 0,
"PB10": 0
},
"TempUnit": "C"
},
Also, before 5.10.0j JSON was translated! (< 5.10.0j)
STATUS = {
"Status": {
"Module": 4,
"FriendlyName": "XXX",
"Topic": "sonoff",
"ButtonTopic": "0",
"Power": 0,
"PowerOnState": 0,
"LedState": 0,
"SaveData": 1,
"SaveState": 1,
"ButtonRetain": 0,
"PowerRetain": 0
}
}
STATUS1 = {
"StatusPRM": {
"Baudrate": 115200,
"GroupTopic": "sonoffs",
"OtaUrl": "X",
"Laufzeit": 8,
"Sleep": 0,
"BootZähler": 50,
"SaveCount": 121,
"SaveAddress": "F8000"
}
}
STATUS2 = {
"StatusFWR": {
"Version": "5.10.0",
"BuildDatumUhrzeit": "2018.01.12 17:48:45",
"Boot": 6,
"Core": "2_4_0",
"SDK": "2.1.0(deb1901)"
}
}
STATUS3 = {
"StatusLOG": {
"SerialLog": 2,
"WebLog": 2,
"SysLog": 0,
"LogHost": "XXX",
"LogPort": 514,
"SSId1": "YYYY",
"SSId2": "XXX",
"TelePeriod": 300,
"SetOption": "00000009"
}
}
STATUS4 = {
"StatusMEM": {
"ProgramSize": 508,
"frei": 492,
"Heap-Größe": 19,
"ProgramFlashSize": 1024,
"FlashSize": 1024,
"FlashMode": 3
}
}
STATUS5 = {
"StatusNET": {
"Hostname": "XXX",
"IPAddress": "192.168.178.111",
"Gateway": "192.168.178.1",
"Subnetmaske": "255.255.255.0",
"DNSServer": "192.168.178.1",
"MAC": "XX:XX:XX:XX:XX:XX",
"Webserver": 2,
"WifiConfig": 0
}
}
STATUS6 = {
"StatusMQT": {
"MqttHost": "192.168.178.111",
"MqttPort": 1883,
"MqttClientMaske": "XXXX",
"MqttClient": "XXXX",
"MqttUser": "XXXX",
"MAX_PACKET_SIZE": 512,
"KEEPALIVE": 15
}
}
STATUS7 = {
"StatusTIM": {
"UTC": "Mon Jan 22 19:05:14 2018",
"lokale Zeit": "Mon Jan 22 20:05:14 2018",
"StartDST": "Sun Mar 25 02:00:00 2018",
"EndDST": "Sun Oct 28 03:00:00 2018",
"Timezone": 1
}
}
in = {
"idx": 13,
"nvalue": 0,
"svalue": "1.5;99.9;3"
}
STATUS10 = {
"StatusSNS": {
"Zeit": "2018.01.22 20:05:14",
"AM2301": {
"Temperatur": 1.5,
"Feuchtigkeit": 99.9
},
"TempUnit": "C"
}
}
STATUS11 = {
"StatusSTS": {
"Zeit": "2018.01.22 20:05:14",
"Laufzeit": 8,
"VCC": 3.476,
"POWER": "OFF",
"WLAN": {
"AP": 1,
"SSID": "XXXX",
"RSSI": 18,
"APMac": "XX:XX:XX:XX:XX:XX"
}
}
}
private function fixJsonFormatV5100( $string ) {
$string = substr( $string, strpos( $string, "STATUS = " ) );
if ( strpos( $string, "POWER = " ) !== FALSE ) {
$string = substr( $string, strpos( $string, "{" ) );
$string = substr( $string, 0, strrpos( $string, "}" ) + 1 );
}
if ( strpos( $string, "ERGEBNIS = " ) !== FALSE ) {
$string = substr( $string, strpos( $string, "{" ) );
$string = substr( $string, 0, strrpos( $string, "}" ) + 1 );
}
if ( strpos( $string, "RESULT = " ) !== FALSE ) {
$string = substr( $string, strpos( $string, "{" ) );
$string = substr( $string, 0, strrpos( $string, "}" ) + 1 );
}
$remove = [
PHP_EOL,
"\n",
"STATUS = ",
"}STATUS1 = {",
"}STATUS2 = {",
"}STATUS3 = {",
"}STATUS4 = {",
"}STATUS5 = {",
"}STATUS6 = {",
"}STATUS7 = {",
"}in = {",
"}STATUS8 = {",
"}STATUS9 = {",
"}STATUS10 = {",
"}STATUS11 = {",
"STATUS2 = ",
];
$replace = [
"",
"",
"",
",",
",",
",",
",",
",",
",",
",",
",",
",",
",",
",",
",",
"",
];
$string = str_replace( $remove, $replace, $string );
return $string;
}
Home | Wiki | What's new | Tutorials | FAQ | Troubleshooting | Button usage | Commands | Rules
Home
Theo's Tasmota Tips
What's New
Getting Started
Upload tools
- SonOTA
- OTA over SCP
- Esptool
- Arduino IDE
- PlatformIO
- PlatformIO CLI
- Visual Studio Code
- Python HTTP OTA server
- Node Red OTA server and firmware manager
Usage
- Button Functionality
- MQTT Features
- Supported Commands
- Using Rules
- Sensor Configuration
- PowerOnState Configuration
- SwitchMode/SwitchTopic
- Button Multipress
- Energy Saving
- KNX Features
- Misc. Tips
Devices - Additional Info
- Sonoff Basic
- Sonoff SV
- Sonoff S20 Smart Socket
- Sonoff S26 Smart Socket
- Sonoff Dual / Dual R2
- Sonoff 4CH / 4CH Pro
- Sonoff RF and Slampher
- Sonoff RF Bridge 433
- Sonoff Pow / Pow R2
- Sonoff Touch
- Sonoff T1
- Sonoff B1 / B1 R2
- Sonoff iFan02
- Sonoff SC
- Sonoff PSA
- Sonoff S31
- Shelly 1 and 2
- Wemos D1 R1 & R2
- Wemos D1 Mini
- HuaFan Smart Socket
- Hyleton-313 Smart Plug
- MagicHome LED controller
- H801
- Arilux LC02
- SP108E LED controller
- Blitzwolf SHP2
- Tuya Dimmer
- PS-16-DZ Dimmer
- Armtronix Dimmers
- Other Devices
- retired
Home Automation Integration
- OpenHAB
- Home Assistant
- Domoticz - Manual configuaration
- Domoticz - Automatic discovery
- HomeBridge
- HomeSeer
- SmartThings
- IP-Symcon
- IOBroker
- TasmoAdmin
- Alexa
- Yeti
- NodeRed Examples
- Securing your Setup
Other Integrations
Further Topics
- MQTT Overview
- Remote Button
- Modified Kaku
- PZEM004T Energy Monitor
- IR Extension
- S20 sensor
- Wiring additional things to a module
- Sonoff Basic DHT11 Wiring
- Expand Sonoff 4CH with jack plug
- Defining new module types
- GPIO Locations
- JSON Status Responses
- Expand Sonoff Basic to 4MB Flash
- Time Proportioned Output support
- PID Control with Sonoff Devices
- Sensor-API
- Sensors Supported by Tasmota
- Syslog Setup
ESP32
Misc