Shelley 1PM

Shelley 1PM wiring 
https://shelly.cloud/
Products page
Results
https://shelly.cloud/products/shelly-1pm-smart-home-automation-relay/
Shelly 1PM page


No need to install an App or an Account unless integrating it with Google Assistant or needing remote access

Setup
Connect to power
Find Wifi AP address in the form
Shelly1pm-[mac address] and connect to it
Go to browser and type address below and
setup Wifi and initial settings

http://192.168.33.1
AP configuration

Client mode after setup <ip> Your local Shelley-1PM IP address

http://<ip>/ Home page - for configuration

http://<ip>/status
Returns JSON page
https://shelly-api-docs.shelly.cloud/#shelly1-1pm-status
http://<ip>/relay/0 Current status
https://shelly-api-docs.shelly.cloud/#shelly1-1pm-relay-0
http://<ip>/relay/0?turn=on Turn On
{
ison:true,
has_timer:false,
timer_started:0,
timer_duration:0,
timer_remaining:0,
overpower:false,
source:http

}
http://<ip>/relay/0?turn=off Turn Off
{
ison:false,
has_timer:false,
timer_started:0,
timer_duration:0,
timer_remaining:0,
overpower:false,
source:http

}






VB example
 JSON = urlLaunch("http://192.168.1.161/status")
Get the JSON status result or blank if offline
VB6 routine
(requires
Microsoftl XML, v5.0 reference )
Private Function urlLaunch(ByVal URL As String) As String
Dim Ans As String
Dim oHTTP As MSXML2.XMLHTTP, sBuffer As String
   
    ModuleName = "urlLaunch"
    On Error GoTo HandleError
   
100    Set oHTTP = CreateObject("MSXML2.ServerXMLHTTP")
105    oHTTP.setTimeouts 3500, 3500, 3500, 3500
110    oHTTP.open "GET", URL, False
120    oHTTP.send
130    sBuffer = oHTTP.responseText
140    Set oHTTP = Nothing
150    urlLaunch = sBuffer

HandleExit:
    Exit Function

HandleError:
    urlLaunch = ""
    Set oHTTP = Nothing
    On Error GoTo 0
   
End Function

VB6 convert JSON result to readable
Function JSONFormat(JSON As String) As String

    y = Replace(JSON, vbTab, "")
    y = Replace(y, vbLf, "")
    y = Replace(y, "{", "{" & vbCrLf)
    y = Replace(y, "}", vbCrLf & "}")
    y = Replace(y, ",", vbCrLf)
   
    JSONFormat = y
  
End Function
Download JSON.exe Converter tool

Download JSON.zip Converter tool