Closed galadril closed 8 years ago
Milestone for v2?
I don't use this functions right now But can test it if you want. there is a forum member willing to go premium if this function is done :)
Just some information about the security panel:
Get Password: GET http://ip:port/json.htm?type=settings JSON: "SecPassword" : "2adcefe38fbcd3dcd45908fbab1bf628",
ARM HOME: GET http://ip:port/json.htm?type=command¶m=setsecstatus&secstatus=1&seccode=2adcefe38fbcd3dcd45908fbab1bf628
GET STATUS GET http://ip:port/json.htm?type=command¶m=getsecstatus
Example Switch Device JSON: { "AddjMulti" : 1.0, "AddjMulti2" : 1.0, "AddjValue" : 0.0, "AddjValue2" : 0.0, "BatteryLevel" : 100, "CustomImage" : 0, "Data" : "Normal", "Description" : "", "Favorite" : 0, "HardwareID" : 1000, "HardwareName" : "Unknown?", "HardwareType" : "Unknown?", "HardwareTypeVal" : 0, "HaveDimmer" : false, "HaveGroupCmd" : false, "HaveTimeout" : false, "ID" : "148702", "LastUpdate" : "2015-10-26 19:42:41", "MaxDimLevel" : 0, "Name" : "Security panel", "Notifications" : "false", "PlanID" : "0", "PlanIDs" : [ 0 ], "Protected" : false, "ShowNotifications" : true, "SignalLevel" : 6, "Status" : "Normal", "StrParam1" : "", "StrParam2" : "", "SubType" : "Security Panel", "SwitchType" : "Security", "SwitchTypeVal" : 0, "Timers" : "false", "Type" : "Security", "TypeImg" : "security", "Unit" : 0, "Used" : 1, "XOffset" : "0", "YOffset" : "0", "idx" : "65" },
Did this got implemented for DomoticzForAndroid ? I'm building a Windows Phone app, Ticz, which I'd like to have the same functionality. The JSON requests are straight forward, but how to validate a user input password against the SecPassword, to see if it matches... ?
In case you might want to implement this for your App. I figured out how to handle the entered code and compare it with the hashed password. It requires the code to be hashed with MD5. The rest of the Security Panel is relatively simple, and I got it fully working for Windows 10 :)
In VB.Net the code below handles the hashing, and might be of help when implementing it for your app !
Public Sub CreateSecurityHash()
Dim codeBuffer As IBuffer = CryptographicBuffer.ConvertStringToBinary(CodeInput, BinaryStringEncoding.Utf8)
Dim alg As HashAlgorithmProvider = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Md5)
Dim buffHash As IBuffer = alg.HashData(codeBuffer)
If Not buffHash.Length = alg.HashLength Then
Throw New Exception("There was an error creating the hash")
Else
CodeHash = CryptographicBuffer.EncodeToHexString(buffHash)
End If
End Sub
this is already implemented for quite some time now in our app..
But we've moved to another github place: https://github.com/domoticz/domoticz-android
ok, thanks :) I encountered this repository when searching for a way to convert the code to the required hash :)
Maybe implement a security panel just like how it's done in Domoticz? NOTE: I don't use this at the moment, so don't know how this works. you maybe remb0??