I have yet to delve into using web functions so I thought it best to ask a couple of questions for some direction before I get too far into this project.
I’m now sending Web (HTTP) commands to smart devices flashed with Tasmota firmware and would like to strip off returned status information in an HTML Viewer. The URL commands like this:
Var Off_URL As Text = “http://” + Address(Index).value.toText + “/cm?cmnd=Power%20Off”
WebViewer(index).LoadURL(Off_URL)
When I send a Web (HTTP) Status request I would like to strip off the returned “Power”:Off/On portion to set on/off radio buttons in my home automation system to mimic smart switch status. I’m thinking it could be treated as a string. Any suggestions on how to do this?
Returned value in HTMLViewer
{“Time”:“2020-11-25T19:51:48”,“Uptime”:“1T22:22:11”,“UptimeSec”:166931,“Heap”:25,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“MqttCount”:0,“POWER”:“OFF”,“Wifi”:{“AP”:1,“SSId”:“Cliff’s Wi-Fi Network”,“BSSId”:“3E:94:ED:37:87:9D”,“Channel”:6,“RSSI”:84,“Signal”:-58,“LinkCount”:1,“Downtime”:“0T00:00:04”}}
I’m not sure my approach is sound but it’s working other than getting the return status info I need. I’m open to a better direction if I’m off in the weeds on this.