Created
April 1, 2020 23:42
-
-
Save egermano/2c6df4d75e71060845764f6e0f25d244 to your computer and use it in GitHub Desktop.
Sonoff DIY Postman Collection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "45c0996e-ac5e-4271-80e1-a09a16391a27", | |
"name": "Sonoff Mini", | |
"values": [ | |
{ | |
"key": "sonoff_ip", | |
"value": "10.0.1.32", | |
"enabled": true | |
}, | |
{ | |
"key": "port", | |
"value": "8081", | |
"enabled": true | |
}, | |
{ | |
"key": "device_id", | |
"value": "100098b2e7", | |
"enabled": true | |
} | |
], | |
"_postman_variable_scope": "environment", | |
"_postman_exported_at": "2020-04-01T23:40:43.757Z", | |
"_postman_exported_using": "Postman/7.21.1" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"info": { | |
"_postman_id": "f4f3ae1c-3acc-47c1-b429-7ff12d107a78", | |
"name": "DIY", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Switch", | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"name": "Content-Type", | |
"value": "application/json", | |
"type": "text" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n \"deviceid\": \"{{deviceId}}\",\n \"data\": {\n \"switch\": \"on\"\n }\n}" | |
}, | |
"url": { | |
"raw": "http://{{sonoff_ip}}:{{port}}/zeroconf/switch", | |
"protocol": "http", | |
"host": [ | |
"{{sonoff_ip}}" | |
], | |
"port": "{{port}}", | |
"path": [ | |
"zeroconf", | |
"switch" | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Setup wifi", | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"name": "Content-Type", | |
"value": "application/json", | |
"type": "text" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{ \n\t\"deviceid\": \"{{device_id}}\", \n\t\"data\": {\n \t\"ssid\": \"network name\", \n \t\"password\": \"secret password\"\n } \n }" | |
}, | |
"url": { | |
"raw": "http://{{sonoff_ip}}:{{port}}/zeroconf/wifi", | |
"protocol": "http", | |
"host": [ | |
"{{sonoff_ip}}" | |
], | |
"port": "{{port}}", | |
"path": [ | |
"zeroconf", | |
"wifi" | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Device Info", | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"name": "Content-Type", | |
"value": "application/json", | |
"type": "text" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{ \n\t\"deviceid\": \"{{device_id}}\", \n\t\"data\": { } \n }" | |
}, | |
"url": { | |
"raw": "http://{{sonoff_ip}}:{{port}}/zeroconf/info", | |
"protocol": "http", | |
"host": [ | |
"{{sonoff_ip}}" | |
], | |
"port": "{{port}}", | |
"path": [ | |
"zeroconf", | |
"info" | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Unlock OTA", | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"name": "Content-Type", | |
"value": "application/json", | |
"type": "text" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{ \n\t\"deviceid\": \"{{device_id}}\", \n\t\"data\": { } \n }" | |
}, | |
"url": { | |
"raw": "http://{{sonoff_ip}}:{{port}}/zeroconf/ota_unlock", | |
"protocol": "http", | |
"host": [ | |
"{{sonoff_ip}}" | |
], | |
"port": "{{port}}", | |
"path": [ | |
"zeroconf", | |
"ota_unlock" | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Flash OTA", | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"name": "Content-Type", | |
"value": "application/json", | |
"type": "text" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n \"deviceid\": \"{{device_id}}\",\n \"data\": {\n \"downloadUrl\": \"http://192.168.15.15/sonoff-basic.bin\",\n \"sha256sum\": \"74ab67860bc6813b1f023355afa994d3935fb989b6400fc0145d507cc06d60ee\"\n }\n}" | |
}, | |
"url": { | |
"raw": "http://{{sonoff_ip}}:{{port}}/zeroconf/ota_flash", | |
"protocol": "http", | |
"host": [ | |
"{{sonoff_ip}}" | |
], | |
"port": "{{port}}", | |
"path": [ | |
"zeroconf", | |
"ota_flash" | |
] | |
} | |
}, | |
"response": [] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment