ripnet / streamdeck-hubitat

Hubitat integration for the Elgato Stream Deck
MIT License
22 stars 8 forks source link

Can't Set Hostname #2

Closed eshanks16 closed 3 years ago

eshanks16 commented 3 years ago

I installed 1.2 of the plugin and the Device section still says "set hostname" even after filling out the hostname and Access Token fields. It's as if I can't save the hostname value.

Is this a permissions issue? Running this on a Macbook Pro (Catalina).

ripnet commented 3 years ago

Unsure, I'll take a look. Thanks for reporting

eshanks16 commented 3 years ago

Thank you for writing this. I just got a streamdeck and am excited for hubitat integrations. Let me know if I can help provide more feedback or something.

ripnet commented 3 years ago

@eshanks16 Should be fixed in v1.4

40e09c0

eshanks16 commented 3 years ago

I tried 1.4 and do see that the Hostname and Access Token fields seem to persist. But the "Device" field never populates any objects. The hostname can be an IP Address in form [x.x.x.x] right and doesn't need "http(s)://" included? That was blurred out in the readme.

ripnet commented 3 years ago

Yes, just the hostname (or IP). Does your hub need https? I just realized I'm hardcoding http.

If the correct IP and access token are entered, the devices *should populate.

ripnet commented 3 years ago

Also, if you want, you can try debugging.

defaults write com.elgato.StreamDeck html_remote_debugging_enabled -bool YES

Then restart StreamDeck. Open the properties for the button (where you put the hostname in), and browse to http://localhost:23654/ and select "com.ripnet.hubitat PI". There, you can watch for any errors in the console while you put in the hostname and token.

https://developer.elgato.com/documentation/stream-deck/sdk/create-your-own-plugin/

eshanks16 commented 3 years ago

Those troubleshooting instructions were really helpful. Thank you. It looks like I'm getting a 404 error. IP Address and token seem fine, but there is a "229" listed after the /apps/api/229/ in the string which doesn't match my environment. I'm wondering if this got hard-coded someplace? If I take the URL and modify that to match my makerID, i can get return data in my browser at least.

ripnet commented 3 years ago

Oh yes, that's it. I assumed that was probably the API version number, but maybe not. I suppose I should probably expose the entire URL as a field? ie http://1.1.1.1/apps/api/xxx/

eshanks16 commented 3 years ago

That might make it the most flexible option? I can't say, but glad you were able to confirm that. Really appreciate your work here.

ripnet commented 3 years ago

Ah, it's the App ID, not an API version :P

Try v1.5

Instead of just the hostname, you'll need the URL: http://1.1.1.1/apps/api/229

If that works, I'll update the documentation.

eshanks16 commented 3 years ago

Working great on 1.5!!! Thank you so much. This is great work!

ripnet commented 3 years ago

Thanks for your help troubleshooting! Feel free to suggest any features that you'd like.