Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get dasshio to connect to HA IP address #110

Open
brucemiranda opened this issue Sep 13, 2022 · 5 comments
Open

How to get dasshio to connect to HA IP address #110

brucemiranda opened this issue Sep 13, 2022 · 5 comments

Comments

@brucemiranda
Copy link

Currently I have my dash buttons recognised but they appear to be calling a URL starting with http://hassio/homeassistant/
e.g. In the log I can see a call to http://hassio/homeassistant/api/services/media_player/toggle but then I get a 500 Bad Request.

On my local network I cannot access my Home Assistant using http://hassio/homeassistant I need to use the IP address http://192.168.1.11:8123

So how do I get either Home Assistant or Dasshio changed so that they can work with each other?

@suheilpurewal
Copy link

were you ever able to figure this out? just started trying to set this up and realized i'm running into the same problem.

@brucemiranda
Copy link
Author

No. I cannot find any information on how to change the base url used by dasshio without running the entire component locally and editing the code to suit me

@brucemiranda
Copy link
Author

I just simply could not figure out how to change the Base URL that is used to access the internal api. So I solved this by using the full external REST API URL, with an Access token.

example.

- name: dash_airwick
  address: 50:f5:da:b7:f4:fc
  url: http://192.168.1.11:8123/api/services/media_player/media_play_pause
  headers: >-
    {"Authorization": "Bearer TOKEN",
    "content-type": "application/json"}
  body: "{\"entity_id\": \"media_player.study_player\"}"

@danimtb
Copy link
Owner

danimtb commented Jun 12, 2023

Thanks for posting here the solution!

I was checking this and it seems that the internal URL for add-ons to contact HA changed: https://developers.home-assistant.io/docs/add-ons/communication/#home-assistant-core

Anyway, this can be solved as you did use the API URL directly.

Please, keep in mind that I am no longer maintaining this addon as Amazon Dash Buttons stopped working for me after Amazon discontinued them and "bricked" them on purpose. If you are still doing fine with the buttons and this addon, please let me know and I'll try to give at least some minimum support to this addon. Thank you :)

@brucemiranda
Copy link
Author

brucemiranda commented Jun 12, 2023

Thanks for posting here the solution!

I was checking this and it seems that the internal URL for add-ons to contact HA changed: https://developers.home-assistant.io/docs/add-ons/communication/#home-assistant-core

Anyway, this can be solved as you did use the API URL directly.

Please, keep in mind that I am no longer maintaining this addon as Amazon Dash Buttons stopped working for me after Amazon discontinued them and "bricked" them on purpose. If you are still doing fine with the buttons and this addon, please let me know and I'll try to give at least some minimum support to this addon. Thank you :)

Would it be possible to make the internal URL and token used by this add-on a configuration or yaml item. You can prefill it with what you expect, rather than use the BASE_URL environment variable as your default. I do use your add-on a lot so would be very appreciative if you could make this change so that it stays a bit future proof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants