I dont know what happend but after restart watch it start working. Before after start app from watch was just black screen and after while error come out.
I think I can explain what happened to you. It just happened to me. First l had the Communications.BLE_QUEUE_FULL (-2), then a “No Internet connection” the next time. Next time, try moving within Bluetooth range of your mobile phone and trying again.
Now I’ve put in code to try and detect the “out of range of your phone” condition using System.getDeviceSettings().phoneConnected and System.getDeviceSettings().connectionAvailable, but wasn’t expecting it to come up with a Communications.BLE_HOST_TIMEOUT as that indicates there was Internet when the HTTP request was initiated.
It wouldn’t have helped you on this occaision, but I could perhaps make the “No Internet connection” more precise based on phoneConnected and connectionAvailable results.
I think a low-hanging fruit would be to display the status of any entity, with the possibility to override the name/title of the entity on the JSON.
I could imagine the use cases being here showing the outdoor/indoor temperature, charging status of an EV vehicle, perhaps the zone a specific user is in etc. All of these would be made possible with the above.
Also, thank you for implementing this. It’s been rock solid for me since I got the setup working.
Thank you for this project. Would be possible to do some manual for dummies? I have a Nabu Casa Cloud, I have created the json file on the HA, but I am getting -400 error on watch. I have put json here
We’re not using Nabu Casa Cloud for our public access, so I am not familiar with your particular setup and constraints. Its these variations that make doing a “manual for dummies” slightly hard, and why we opted for generic URLs. Our dummies guide is the README.md! That way the responsibility for setting up URLs and APIs is not our responsibility! That said, when you find the solution, please post it on this thread for others to find.
There’s another discussion providing some clues at Use Nabu Casa URL to use HA API? Their API URL is similar, but without the default port for HA (8123), which I assume is HTTP not HTTPS and hence you are not connecting to the HTTPS server which would be on port 443 (no need to specify in the URL). So try https://<>.ui.nabu.casa/api?
And it took me a while, but for anyone else. The app isn’t a glance but as an activity sort of
Correct, the app has no glance view implemented (yet), hence it does not get added to the carosel. But it is an App, and gets listed with the other apps that include activities too.
Great app, works fantastic. Thank you for your work. One question I have.
In the json file, the word “tap” (behind the “type”) is frequently used… In my Garmin it shows up as “Kraan”, which is the dutch translation of the word “tap”. Any idea how to fix this?
In the json file, the word “tap” (behind the “type”) is frequently used… In my Garmin it shows up as “Kraan”, which is the dutch translation of the word “tap”. Any idea how to fix this?
We’ve implemented an automatic translation override. Please indicate the preferred word for “tap” as in “press and don’t hold”. Perhaps “Tik”
Tap on the window
Tap in the sink
Tik op het raam
Kraan in de gootsteen
I’ve just published a new version (1.4) which will alleviate the problem by allowing you to choose not to have the second row of text which is instead replaced by an icon thanks to a code contribution from a user.
Unfortunately I cannot get this to work. I simply get a “-400 Response body data is invalid for the request type.” error.
I’ve double checked my API key, json url and api but can’t find anything wrong with it. I am using HA behing a NGIX proxy and 2FA setup but I guess that should not really matter…
As you will see from the link to the error codes above, -400 relates to INVALID_HTTP_BODY_IN_NETWORK_RESPONSE.
That suggests to me that your webserver is returning something other than JSON in its reply. In this situation the reply is often plain text with an error messages, e.g. about authentication failure, or a problem serving the URL. The former suggests the API key might not be right, e.g extra spaces front and end. The latter can be checked by browsing to the intended URL and checking JSON is displayed.
Due to the limits of the Connect IQ API, I cannot get the plain text before the function call parses the expected JSON in order to display it. Perhaps I could make a second call and request plain text for displaying the error…
Thanks. I’ve double checked the API key and also created a new one. The json is being displayed when I copy and paste the URL in the browser which is why I am at a loss as to why this doesn’t work…
Seems like I am getting closer. I removed the comma and now I am still getting the error but when I swipe back on the watch (left to right swipe) I briefly see the switch but it goes immediately back to the original -400 error…
Hmm. Thinking out loud. It sounds like you have got the menu config URL with JSON working. The next error is likely to be a failure to update the present toggle’s status. That means an issue accessing the API to query the switch’s present state.
Do you have the means to use curl? If so, you should be able to check that when you substitute API_KEY and URL below, you get JSON back.