I was surprised to see that there is no iOS widget that can display basic sensor data, yet. So I created one using the iOS Scriptable App. I hope this is helpful for some
You can find the source code of the widget on GitHub. There are many known issues (support for UI dark mode, error handling of non-resposive APIs etc.) so please feel free to fork and improve!
while i liked your code a while ago i am still very impressed how besutiful this is and surprised that no comment came up, but ifelt like you deserved a bit feedback - this is AMAZING!!!
next tome i have so spare time i definitly will use it to imtegrate this
hey its been a while but im atm struggeling with the widget: my states doesnt seem to get updated, is it just me or is it scriptable whos causing this? greetings
I’m running Home Assistant 2021.9.6 and iOS 15 with Scriptable App 1.6.6 and everything is working smoothly.
I can imagine two things:
A) If it never worked, I guess you misconfigured/forgot to edit the widgetcode (which is required)
B) If it worked in the past and now simply stopped working, I guess the HASS REST API or your access token isnotresponding/working correctly.
If you have access to a Mac, you can also test and debug the widget on your computer using this:
Download: Scriptable for Mac
If you are into it, you can also poke the REST API via CLI (or have a look here for an less-techi solution) curl --insecure -H 'Authorization: Bearer *--{Your HASS Long-Lived Access Token here}--*' -H 'content-type: application/json' https://*--{HASS IP}--*/api/states
it should return a long list/string of sensors and their states.
Ah well, thanks for your answer. And i really will again appreciate your way of using scriptable for ios here!
I can access the Values in the Scriptable Widget and can reflect my sensor states there and same Setup: HassIO 2021.9.6, iOS 15 and today updated scriptable. The Problem is more about the current state: scriptable seems to get everything correctly when running it but as a widget on my homescreen this state remains unchanged till i rerun the script in the scriptable app
Hi,
I would also like to thank you for the great job you have done. This is really helpful:)
The code is working perfectly, but I would like to have the temperature to be displayed with decimals(float), like 24.5 degrees…is there a way I can do that ?
Thanks
Well, you could use images from the Google Image search. Other Scriptable widgets out there use links pointing to Imgur for example:
https://i.imgur.com/Qp8CEFf.png
If your home assistant is running on your local network only, you will not be able to access your instance while - say - traveling etc. the widget would be quite useless in this case, right?!
I suggest you investigate how to host your instance using Let’s Encrypt. For example like this:
I have Nabu Casa so its just a matter of where do I place these images on my HA instance.
For instance, I would think that I would download the PNG and then transfer the PNG file to some directory on the HA (after accessing HA by SMB).
I will even take it a step further. What if I do not want the images at all. I just want a widget that displays the temperature of 3 different sensors. The thermometer png is wholly unnecessary.