Great work! I've tested the application and modified it to my needs (only have 4 switches and 2 scenes, so I removed 1 switch and 1 scene block)
Something I want to add, this version of DomoticzBoard uses no authorization.
I have the LoginPage of Domoticz enabled so basic-auth is not possible. But it is still needed to use JSON parameter authorization:
documentation
Which basically means adding 2 parameters (DomoticzBoardApp.qml):
Code: Select all
property string username: "dXNlcm5hbWU=" //Base64 encoding of "username"
property string username: "cGFzc3dvcmQ=" //Base64 encoding of "password"
And then edit all the request with:
Code: Select all
username="+username+"&password="+password+"&
or
Code: Select all
username="+app.username+"&password="+app.password+"&
Example (DomoticzBoardApp.qml):
Code: Select all
xmlhttp.open("GET", "http://"+hostName+":"+portNum+"/json.htm?username="+username+"&password="+password+"&type=devices&rid="+idx, true);
Example (DomoticzScreen.qml)
Code: Select all
simpleSynchronous("http://"+app.hostName+":"+app.portNum+"/json.htm?username="+app.username+"&password="+app.password+"&type=command¶m=switchscene&idx="+app.scene2idx+"&switchcmd=Off");
Ps. I tried to use functions like:
but unfortunately this did not work and I had to hardcode the Base64 values.[/i]
I think this would be a nice addon feature. I've not tried HTTPS yet. But for now base64 auth is enough for me.
"The greatest good you can do for another, is not to share your own riches, but to reveal to him, his own."
- Benjamin Disraeli -