Closed xztraz closed 6 years ago
There is possible to replace & with %26. but the text data is limited in length. thereby truncating the adress. well that must be a domoticz specific issue. not the theme.
Could you use the description field instead? i don't think logging of what adress is entered is necessary and description field have a lot more space for addresses.
also scaling and offsett would be interesting in the iframe. say a weather radar. they are always cluttered with buttons and stuff.
I wanted to use description originally, but javascript doesn't have easy access to the description on the dashboard.
How about using a url shortener?
i don't want to make external calls for an internal server for security.. so basicly try to get data lenght in domotics longer to solve this. i'll make a request there if so is the case
hm json gets you the description for the sensor otherwise
test { "AddjMulti" : 1.0, "AddjMulti2" : 1.0, "AddjValue" : 0.0, "AddjValue2" : 0.0, "BatteryLevel" : 255, "CustomImage" : 0, "Data" : "https://192.168.1.197/cgi-bin-zm/nph-zms?scale=50&mode=jpeg&mon", "Description" : "Descriptintext in description. it can be alot longer than anything else ans seem to handle chars as !\"#¤%&/()=?`^**'<>| Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123Test123-should be anough", "Favorite" : 1, "HardwareID" : 8, "HardwareName" : "Dummy", "HardwareType" : "Dummy (Does nothing, use for virtual switches only)", "HardwareTypeVal" : 15, "HaveTimeout" : false, "ID" : "00082897", "LastUpdate" : "2018-02-25 22:52:14", "Name" : "Iframe", "Notifications" : "false", "PlanID" : "0", "PlanIDs" : [ 0 ], "Protected" : false, "ShowNotifications" : false, "SignalLevel" : "-", "SubType" : "Text", "Timers" : "false", "Type" : "General", "TypeImg" : "text", "Unit" : 1, "Used" : 1, "XOffset" : "0", "YOffset" : "0", "idx" : "897" }
Can you test a url with & in the description? does it come through ok?
In description or data field? ☺
Oh sorry. Desc.
Just thinking out loud: an advantage of using the data field is that you could create all kinds of fun things, like sending a URL to Domoticz which then gets displayed in the interface. That could be useful for, for example, administrators that want to show some news or alert to users. Or you could have a url that needs to be programmatically updated (changing a value in it to the current date for example), and always show up to date content that way. Or send an sms/message with a url of a picture, so that the people back home can see pictures from the people out and about.
Perhaps we could ask for the allowed length of text values to be changed in Domoticz, and add some code that lets & work.
The description field can take & as seen in all the text i entered in the example. But as you say if you can write to it from outside that would be a nice feature. I guess you cant change description field via json?
tried a bit more. if you replace all signs with urlencoded ones it works. but you cant edit the text on the button again since it will be encoded as the right signs like &? and then if saving it gets truncated. so this is a domoticz bug but you can work around it as is. long adress seem to work now if replacing?& and such
so closing this
when entered: https://192.168.1.197/cgi-bin-zm/nph-zms?scale=50&width=320&height=240&mode=jpeg&maxfps=5&buffer=1000&monitor=4
Maybe a domoticz bug for the text sensor?