LightwaveRF Binding Updated

dont think it can connect to the net.
that comes up when login fails (http request returns a 404 not found)

Really weird as everything else is okay, Alexa binding etc

Is the certificate you loaded still there? could you have loaded it wrong?

Wrong password :rofl:

Well at least it’s an easy fix :smiley:

@delid4ve does the http request return a different error for that, maybe able to catch it?

What version were you running, going to spin up a docker with an older version to confirm I get the same

Now i’m running openhab 2.5.1 stable

What were you running when you had the first errors

2.5 stable ( 2.5.0-armhf-debian ) and 1.0.6 binding

If it helps anyone, I’ve repurposed some of @delid4ve 's original script to dump your LWRF structure and other info into the log. I’ve found this helpful several times when trying to diagnose various issues:

rule "Get LWRF Structure"
when
Item LWRF_Test_Switch received command ON
then
logInfo("LWRF-TEST.rules", "Rule Started")
logInfo("LWRF-TEST.rules", "Authentication Started")
var String username = "xxxxxxx@example.com"   // Your LWRF username goes here
var String password = "yourpassword"          // Your LWRF password goes here
val Get_Token = executeCommandLine("curl@@-X@@POST@@https://auth.lightwaverf.com/v2/lightwaverf/autouserlogin/lwapps@@-H@@Content-Type: application/json@@-H@@x-lwrf-appid: ios-01@@-d@@{\"email\" : \"" + username + "\",\"password\" : \"" + password + "\"}",5000) 
        var String RefreshToken = transform("JSONPATH", "$.refresh_token" , "{" + Get_Token.substringBetween("\"tokens\":{","}}") + "}") 
        var String AccessToken =  transform("JSONPATH", "$.access_token" , "{" + Get_Token.substringBetween("\"tokens\":{","}}") + "}") 
Refresh_Token.postUpdate(RefreshToken) 
Access_Token.postUpdate(AccessToken)
logInfo("LWRF-TEST.rules", "Refresh Token - " + RefreshToken)
logInfo("LWRF-TEST.rules", "Access Token - " + AccessToken)
logInfo("LWRF-TEST.rules", "Authentication Finished") 
Thread::sleep(3000)
logInfo("LWRF-TEST.rules", "Structure Dump Started")
var String Structure_GET = executeCommandLine("curl@@-s@@-g@@-XGET@@https://publicapi.lightwaverf.com/v1/Structures@@-H@@Authorization:bearer " + AccessToken,5000)
var String Structure_Value = transform("JSONPATH", "$.structures" , Structure_GET)
var Structures_GET = executeCommandLine("curl@@-s@@-X@@GET@@https://publicapi.lightwaverf.com/v1/Structure/" + Structure_Value + "@@-H@@Authorization:bearer " + AccessToken,20000)
var Devices_Count = Integer::parseInt(transform("JSONPATH","$.devices.length()", Structures_GET).toString)
logInfo("LWRF-TEST.rules", "Structures - " + Structure_Value)
logInfo("LWRF-TEST.rules", "My Structure - " + Structures_GET)
logInfo("LWRF-TEST.rules", "Device Count - " + Devices_Count.toString)
logInfo("LWRF-TEST.rules", "Structure Dump Finished")
logInfo("LWRF-TEST.rules", "Rule Finished")
end

Items:

Switch LWRF_Test_Switch
String Refresh_Token
String Access_Token