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

Cannot GET /homeassistant/entities #2

Closed
raddatzk opened this issue Sep 21, 2018 · 25 comments
Closed

Cannot GET /homeassistant/entities #2

raddatzk opened this issue Sep 21, 2018 · 25 comments

Comments

@raddatzk
Copy link

Describe the bug
A clear and concise description of what the bug is.
When I place a nodetype that requires to fetch entities from HA it gives this error message: "Cannot GET /homeassistant/entities"

To Reproduce
Steps to reproduce the behavior:

  1. Go to node-types->homeassistant
  2. Place a "polls state"
  3. Doubleclick on the node
  4. See error

Expected behavior
Show all entities from HA

Screenshots
If applicable, add screenshots to help explain your problem.

Example Flow
If applicable, add an example of exported json of a flow exhibiting the issue to aid in reproduction.

Environment (please complete the following information):

  • Node Red Version: 0.19.4
  • NR Home Assistant Plugin Version: 0.0.1 according to nodered palette
  • Is Node Red running in Docker: no

Other (please complete the following information):

  • Have you searched previous issues for duplicates?:
  • Did you attempt to reproduce the issue in the dev docker environment, if so what were results (See README.md):

Additional context
I am running NR and HA in docker.
In NR I set the baseurl for HA to "http://homeassistant:8123"

@zachowj
Copy link
Owner

zachowj commented Sep 22, 2018

I am not all that familiar with docker so I'm having to do a little research. I did run several tests so far and this is what I have come up.

I spun up two docker containers one running home assistant 0.78.1 and the other node-red 0.19.4. Also ran another instance of home assistant in a python virtual environment and node-red, same versions as above.

node-red => HA venv : connection good for both websocket and rest api
node-red => HA Docker : connection good for both websocket and rest api
node-red Docker => HA venv : connection good for both websocket and rest api
node-red Docker => HA Docker : connection bad for websocket good for rest api

The websocket connection is getting refused by the HA Docker when coming from node-red running in another Docker container.

Still looking into this, no solution as of yet.

@zachowj
Copy link
Owner

zachowj commented Sep 22, 2018

Ok I think I tracked this down to an error in nodejs. They seem to have fixed it in v8.11.2 and v10.10.0. Please try one of those versions of node and let me know if that fixes your issue.

I've tested it on both of those and it fixed my issue using node-red running in docker trying to connect to home-assistant running in docker.

Edit:
v8.12.0 is actually the latest LTS version and seems to work on that also

@danmandle
Copy link

I am having the same/similar issue. I am running nodered/node-red-docker:v8 which has node v8.12.0.

Whenever I double-click on a node, this message pops up: Cannot GET /undefinedhomeassistant/services. Not sure where I'm getting the undefined part.

After looking at the network console, I believe the source of the issue is that it is not honoring the Base URL property of the server node. My node-red deployment is running on a different hostname than my HA install.

@raddatzk
Copy link
Author

I wanted to have a look at my NR again, but "suddenly" the nodes have disappeared. They are still marked as installed, but are not shown in the palette. Even the two that I placed already are gone

zachowj added a commit that referenced this issue Sep 27, 2018
* not going to assume that httpAdminRoot is defined
/issues/2
@zachowj
Copy link
Owner

zachowj commented Sep 27, 2018

@danmandle try version 0.0.3 and let me know if that fixes the undefined in the URL string.

@chronm Not sure if I am following exactly what your latest issue is. Did you make sure you Deployed after you played your nodes?

@raddatzk
Copy link
Author

When I click on the hamburger-menu and then "manage palette" it shows the ha-plugin with version 0.0.2, but the nodes are not shown in the sidebar of the dashboard.
I didn't deploy the flow, but the "raw" nodes in the sidebar should remain there

@danmandle
Copy link

@zachowj 0.0.3 fixed my issues. Thanks! Updated the NPM package manually. Not sure if/what needs to be done to get it into the node-red repo.

@zachowj
Copy link
Owner

zachowj commented Sep 27, 2018

@chronm Can you try removing node-red-contrib-home-assistant-websocket and reinstalling it and see if that brings back the nodes?

@rsuplido
Copy link

rsuplido commented Oct 7, 2018

I’ve had success with version 0.0.7 on hassio. Don’t use http://hassio/homeassistant for the Base URL. Use either localhost, 127.0.0.1, or better, your server’s IP, and port 8123.

@zachowj
Copy link
Owner

zachowj commented Oct 9, 2018

@rsuplido

I’ve had success with version 0.0.7 on hassio. Don’t use http://hassio/homeassistant for the Base URL. Use either localhost, 127.0.0.1, or better, your server’s IP, and port 8123.

I've added support and better instructions for hass.io in version 0.1.0. You can now use the hass.io proxy address http://hassio/homeassistant and the node will automatically fill in the access token with the HASSIO_TOKEN from the proxy when you deploy.

@rsuplido
Copy link

rsuplido commented Oct 9, 2018

If you use http://hassio/homeassistant on the Base URL, do you have to check “Use Legacy API Password”?

Also, on Hass.io, what’s the difference between adding it on the config vs installing it via Manage Template?

Thanks.

@zachowj
Copy link
Owner

zachowj commented Oct 9, 2018

I think I tested it unchecked but can go back in and make sure.

I am not a normal hass.io user but in my testing, I was unable to uninstall node-red-contrib-home-assistant via the palette. But installing node-red-contrib-home-assistant-websocket via the config I believe it is the same either way.

@rsuplido
Copy link

rsuplido commented Oct 9, 2018

Ok. FYI, I’ve been installing it via Manage Palette, updating, and uninstalling, and it all works. It makes it easy actually.

Thanks.

@arnonel
Copy link

arnonel commented Oct 18, 2018

I am also getting "Cannot GET /undefinedhomeassistant/services"

Things seem to be working ok, but this still pops up when I edit a node

@rsuplido
Copy link

I only get that the first time. Make sure you use the IP on the base url. Usually, after you deploy, you'll see it say 'connected.'

@arnonel
Copy link

arnonel commented Oct 18, 2018 via email

@rsuplido
Copy link

rsuplido commented Oct 18, 2018

which version are you running? when do you get it? after HA restart? do you get it after node-red restart? what does the node-red log say? and what do you use on your base URL -- localhost, IP, dynamic DNS?

@rsuplido
Copy link

Also, on hamburger icon->configuration nodes, under 'On all flows', do you see multiple items under 'server'? I bet you have configured a node previously that has some old config or not working.

@zachowj zachowj added Status: Waiting for Response bug Something isn't working and removed Type: Question labels Oct 20, 2018
@Peter-Optiway
Copy link

Peter-Optiway commented Oct 31, 2018

i just tried this on a clean docker installation using the of node version 8, but i get the Cannot GET /homeassistant/services.
i tried both https and http, any idea whats is wrong?
nothing shows up in the debug messages or in the docker logs.
node red runs on a diffrent host than the HA.
What is wrong?

node-red: 0.19.5
node: 8.12.0
npm: 6.4.1
node-red-contrib-home-assistant-websocket: 0.1.3
home-assistant: 0.80.1

Tried the following Base URL:

but all of them yield the same error.
Are there any node red logs i could check? i havent managed to find any

@zachowj
Copy link
Owner

zachowj commented Oct 31, 2018

After deploying is the node showing as connected?
Try removing the trailing forward slash in the URL:

@Peter-Optiway
Copy link

i tied without the trailing slash same error.
The orange/red triangle went away but it did so even if i entered a incorrect port.

@zachowj
Copy link
Owner

zachowj commented Nov 1, 2018

What is the connection status of the node? Should show a Connected, Connecting or Disconnected after you deploy under the node.

@Peter-Optiway
Copy link

Deploying solved the problem!

@zachowj zachowj removed the bug Something isn't working label Nov 26, 2018
@zachowj zachowj closed this as completed Nov 26, 2018
@ronnyandre
Copy link

My Node-Red does not autopopulate entities either, however, it doesn't give an error. The JSON response is only empty object and arrays.

@jeliasson
Copy link

Related issue #63

Repository owner locked as resolved and limited conversation to collaborators Dec 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants