pulsante sonoff

Hello
I need your help, I have already made some small personal apps, following the instructions on this page
( api sonoff page
http://developers.sonoff.tech/sonoff-diy-mode-api-protocol.html )I want to create a button to control a wi-fi switch.
Once activated if the answer is ok it turns green
Thank you and greetings
FaithfulFedele

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

The problem is, it's not what blocks to insert
I create the button, once clicked it must send a request
URL: http://[ip]:[port]/[path] - http://10.243.138.61:8081/zeroconfig/switch

RESTful API Request works in POST method and JSON formatted request body.
{ "deviceid" : "100000140e" , "data" : { "switch" : "on" } }

RESTful API Response works in 200 OK HTTP response code and JSON formatted response body.
if ok
{ "seq" : 2 , "error" : 0 , "data" : { "signalStrength" : -67 } }
green button
regards

If you don't want blocks, then
what is it that you want?

use the web component to send the Post request
http://ai2.appinventor.mit.edu/reference/components/connectivity.html#Web

see an example here App Inventor Tutorials and Examples: Dropbox | Pura Vida Apps
you have to use the PostText method ...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

sorry
i don't speak english, i use google translate
Thanks for the link

A post was split to a new topic: How to post text using Web component?

Ciao Fedele, come hai risolto il problema che IP address del sonoff switch non รจ fisso ma viene assegnato da DHCP del router e quindi cambia molto spesso?