Code Monkey home page Code Monkey logo

Comments (30)

gregg098 avatar gregg098 commented on May 31, 2024 5

I had this problem after I updated the Home Assistant Node Red module to 0.30. It turned out that this version of the module needs NodeJS >8.0. I'm using docker and had to change my docker compose file to pull the v8 image of Node Red.

from node-red-contrib-home-assistant.

schford avatar schford commented on May 31, 2024 2

On line 47 of server-events-state-changed.html - we can see the url it fetches to show entities, as it does not take into account httpRoot variable I have done a quick and dirty hard code - I am sure there must be a better way of fixing this but I am not a coder :-( as you can see below all I have done is manually put in the additional info for my installation.

                $.get('/node-red/homeassistant/entities').done((entities) => {

from node-red-contrib-home-assistant.

lamiskin avatar lamiskin commented on May 31, 2024 1

Apologies for the fuss, I wasn't aware that a flow needed deploying before it will retrieve some information from home assistant. Confirmed working now 👍

from node-red-contrib-home-assistant.

Spartan-II-117 avatar Spartan-II-117 commented on May 31, 2024

Was this working before? I had a similar issue when I first got started, unfortunately i don't remember how I solved it, however, I can tell you that it is working on my docker install of 0.65.5

from node-red-contrib-home-assistant.

forhuan avatar forhuan commented on May 31, 2024

No. I tried to replace /homeassistant/xxx to /api/xxx in node_modules, but it still not work :(

from node-red-contrib-home-assistant.

lamiskin avatar lamiskin commented on May 31, 2024

First time node-red user here, after taking a while to figure out I needed the v8 docker image to get going, I've now run in to a similar issue where node-red states it cannot get Cannot GET /homeassistant/services.

Confirmed home assistant is reachable by using curl within the container.

Running version 0.65.5 of home assistant.

from node-red-contrib-home-assistant.

foobazbar123 avatar foobazbar123 commented on May 31, 2024

Concur. This is no longer compatible with HA

from node-red-contrib-home-assistant.

gregg098 avatar gregg098 commented on May 31, 2024

It is definitely compatible. I'm running the V8 container and using https://xxxxx.duckdns.org:8123 as my server address with no issues. Did you add everything then deploy? Sometimes you will get that "Cannot get...." message before the first deploy.

from node-red-contrib-home-assistant.

foobazbar123 avatar foobazbar123 commented on May 31, 2024

Okay, I'm confused. I nuked the HA config I had done in node-red and redid it. Now it's happy. So, it appears you're correct in that it is compatible but I think changing the error message or something is in order?

from node-red-contrib-home-assistant.

webxl avatar webxl commented on May 31, 2024

I was having an issue as well until I added the Content-Type header (PR: AYapejian/node-home-assistant#3) and made sure that the hostname in the server config matched HA's http -> base_url setting.

I'm not sure which actually got me up and running, but do the latter and perhaps the former won't be necessary, although the API calls should probably match the REST API docs.

from node-red-contrib-home-assistant.

gsbrown avatar gsbrown commented on May 31, 2024

I am on Hassio 0.65.6 and Node Red 0.18.4 and am running into the same Cannot GET /homeassistant/entities error. Is there a way to update to NodeJS 8.0 in Hassio, or am I stuck until the addon gets updated?

Edit: it just started working all of a sudden... never mind.

from node-red-contrib-home-assistant.

foobazbar123 avatar foobazbar123 commented on May 31, 2024

@gsbrown Same thing that happened for me. That error, nothing would fix it, then poof.. started working

from node-red-contrib-home-assistant.

skylord123 avatar skylord123 commented on May 31, 2024

I also was getting issues until I removed base_url from my home assistant config.

from node-red-contrib-home-assistant.

tedstriker avatar tedstriker commented on May 31, 2024

I'm experiencing the same Cannot GET /homeassistant/entities error with NodeJS 8, NodeRed 0.18.4 and no base_url set in home assistant version 0.66.0 using docker for NodeRed. Meanwhile everything has been deployed multiple times.

from node-red-contrib-home-assistant.

skylord123 avatar skylord123 commented on May 31, 2024

@tedstriker are you connecting to another docker container on the same machine? (node-red running in docker as well as home assistant). I notice I have to set the internal IP of my host machine (given by my router) into the docker container otherwise it can't connect to home assistant (localhost on my docker container points to the container not the host machine).

from node-red-contrib-home-assistant.

tedstriker avatar tedstriker commented on May 31, 2024

@skylord123 home assistant is running on a Pi and I can also receive events, etc. in nodered but when I open the state event node I receive two Cannot GET /homeassistant/entities error messages.

from node-red-contrib-home-assistant.

nibotg avatar nibotg commented on May 31, 2024

@skylord123, I'm new to node red but am trying to run home assistant and node red in docker containers on a Synology nas. I've experienced the same Cannot GET /homeassistant/entities message. Can you explain what you mean by setting the internal IP of the host machine please ?

from node-red-contrib-home-assistant.

Spartan-II-117 avatar Spartan-II-117 commented on May 31, 2024

@nibotg did you get your issue firured out? you need to use the IP address of the computer instead of localhost or 127.0.0.1:8123 since within a container, those refer back to the same container.

@forhuan can this be closed?

from node-red-contrib-home-assistant.

s3Pol avatar s3Pol commented on May 31, 2024

I'm having the same issue (Cannot GET /homeassistant/entities).
Already tried to change the file ha-api.js to add the Content-Type, HA config with base_url and without, NodeRed Base Url with localhost, 127.0.0.1, local ip...
With curl the api return {"message": "API running."}.
Any tips?

ENV::
Raspbian
Home Assistant 0.68.0.dev0
Node-RED version: v0.18.4
Node.js version: v9.10.1
node-red-contrib-home-assistant 0.3.0

from node-red-contrib-home-assistant.

nibotg avatar nibotg commented on May 31, 2024

Hi @Spartan-II-117, no I'm afraid I didn't. I am using the IP address of the Synology nas but still get the same message. Any ideas appreciated please!

from node-red-contrib-home-assistant.

skylord123 avatar skylord123 commented on May 31, 2024

@nibotg Did you set the repository version to v8? This is what I have set as my repository which also fixed the issue for me nodered/node-red-docker:v8 instead of nodered/node-red-docker.

EDIT: Also make sure your port is being exposed to the NAS.

from node-red-contrib-home-assistant.

nibotg avatar nibotg commented on May 31, 2024

@skylord123, no, I had been using the latest version. I've just switched to v8 (installed through the DSM GUI) and it works! Many thanks for your help.

from node-red-contrib-home-assistant.

kimmeld avatar kimmeld commented on May 31, 2024

I've been playing with this and found that node-red-contrib-home-assistant is trying to talk to Home Assistant using /homeassistant/entities, etc, URLs.

Some examples:

NOTE: There's more, this is just three examples.

All of these reference URLs that are not valid according to https://developers.home-assistant.io/docs/en/external_api_rest.html

I'm running Home Assistant 0.66.1 and made these changed all of the instances of "/homeassistant/" to "/api/" in my node-red-contrib-home-assistant and things are working fine.

from node-red-contrib-home-assistant.

Spartan-II-117 avatar Spartan-II-117 commented on May 31, 2024

@kimmeld can you write a PR to correct this?

from node-red-contrib-home-assistant.

gregg098 avatar gregg098 commented on May 31, 2024

@kimmeld
I'm running Node Red in Docker (V8 image). My old configuration was using DuckDNS with LetsEncrypt. My Hass address was https://xxxx.duckdns.org:8123. Now I use NGINX to deal with external connections and use http://ipaddress:8123 for my NodeRed URL since its on the same network. Both configurations worked flawlessly. What I'm saying is that I could make an assumption those two configurations cover at least 90% of the Home Assistant community who uses Node Red successfully. If you are having some kind of issue that requires you to change the source code of Node Red, there is some other issue going on in your setup. I would recommend posting specific information about your configuration because you are going to fight this problem every time a new version comes out. I don't think a PR is justified here because the issues seem fairly isolated.

from node-red-contrib-home-assistant.

kimmeld avatar kimmeld commented on May 31, 2024

@gregg098 What version of Home Assistant were you using? I get the impression from my research into this problem that they changed where their API endpoint is located.

I didn't make changes to Node-RED itself, only minor changes to a handful of files in node-red-contrib-home-assistant to make some URLs match what Home Assistant is expecting.

@Spartan-II-117 I'll see what I can do.

from node-red-contrib-home-assistant.

AYapejian avatar AYapejian commented on May 31, 2024

I'm pretty confused on what the actual issue here for the record I'm using homeassistant version 0.68.1 and everything works just fine.

The /homeassistant/entities path mentioned above is not to communicate with home assistant, not directly anyways. That is used to make a call from the node-red frontend into the node-red backend which then proxies to the correct .../api/... address against the home assistant server, no change there should be required.

from node-red-contrib-home-assistant.

kimmeld avatar kimmeld commented on May 31, 2024

I’ve been reading more of the code and I was completely incorrect about what those URLs do. My “fix” is completely invalid and must have coincided with whatever I did that actually fixed the problem. I reinstalled and made sure my changes were gone and it still works.

Sorry for the extra noise on this issue.

from node-red-contrib-home-assistant.

AYapejian avatar AYapejian commented on May 31, 2024

No worries. I think I'm going to close this issue as the thread is pretty disjointed and I believe everything discussed here has been environment related. If anyone is having issues still please open a specific issue with details or file a bug.

from node-red-contrib-home-assistant.

schford avatar schford commented on May 31, 2024

I think it is to do with when you change the below- if you change http route then it no longer pulls the data form home assistant - anyone got any ideas? I need to change the http root to be able to reverse proxy with lets encrypt

// The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot',
// to apply the same root to both parts.
//httpRoot: '/node-red',

from node-red-contrib-home-assistant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.