Hi! I’m making a series of widgets using Scriptable, from iOS. Today I have finished my first widget, to show 3 different temperatures.
The widget only needs to be configured with the username and password, to obtain the data. Obviously it can be edited to anyone’s whim, I hope this helps.
I configured the widget in such a way that I could get the data, via myopenhab.org to be able to use it anywhere.
In the next few days I will be uploading more widgets.
Thank you for the widget.
Will try to set it up with my OH installation.
I was already wondering why there are no widgets for openhab available… but now this changes. Looking forward to test the ones you will release
Unfortunately my programming skills are nearly zero, so I am not able the build my own widgets.
Exactly! Please, check in Configuration → openHAB Cloud, if the Base URL is myopenhab.org as seen in my image. If not, edit the widget code with the url you use. Generally the port that openhab uses to communicate is 443.
Additionally, thanks to your capture, I discovered that I have not set to truncate decimals, among other things. Please check GitHub again for improvements. Thank you very much for helping me improve the widget!
Yes, you need to encode all the username and password BUT… (Thanks again to you) I updated the widget so that you simply need to put your username and password normally and the code will encode for you, forget about character encoding and headache
Please, try with the new code and tell me! BTW first try to conect with the browser so we can rule out future problems.
If you want to test with the browser first, I create a script for you that will encode to get the URL you should use. Add a new script file in Scriptable and paste this
// Define your user and passwork normally
var user = 'firstname.lastname@example.org'
var password = 'super,?pass'
var user_tobrowser = encodeURIComponent(user)
var pass_to_browser = encodeURIComponent(password)
console.log('User to use in browser: ' + user_tobrowser)
console.log('Password to use in browser: ' + pass_to_browser)
Once executed, in the scriptable log you will see your username and encrypted password that you will place in your browser
Yeah You guessed my next widget … honestly my idea was to use icons instead of text to know the status, for example: “light” → lamp icon, with colors. This weekend, I’ll move on with that
Another idea of mine … I developed a group of services and I would like to know its status on my iphone, there will also be a new widget with dynamic icons.
Although I think the idea is correct, I do not know if the code is correct but leave me a few days, maybe hours (I am impulsive) and we will solve it.
Well I think this is the longest answer in the community… I think I deserve a Simpsons episode! Regards
Ok… there is some success. This was the issue: I got a ! in my password, so I converted this to %21. But it looks like this was wrong. No need to encode the ! .
If I encode the user and password with your script the connection via browser works. BUT I need to log in. There is a pop up log in window. Looks like the credentials are not parsed to the site. Afer I logged in the REST works.
The idea about your upcoming widgets sounds great. I got a lot of items in openhab, so maybe you can help me some day to create a layot where all my items fit into different widgets. I would use the largest iOS widget size, so the layout would be total different.
Edit: based on this page URL ENCODING change unnecessary characters like letters and numbers and the url is still functional. I’m a bit confused. What happens when you put the credentials in the widget? Works?