Home Assistant Community Add-on: Node-RED

I wanted to say, “You are welcome”. But I think an apology from my side is more appropriate at this time.

As for any update on any platform. My personal grind, is “downgrading” add-ons seems impossible (but it is possible via the CLI).

Nevertheless, hold on, I already have the code editors open…

:tada: Release v0.4.0

See my posts above for the exact reasoning behind this release.

Again, my apologies. :heart:

Full Changelog

Changed

  • Downgrades the add-on back to the original node-red-contrib-home-assistant
  • Upgrades node-red-node-suncalc to version 0.0.11 (#14)

Manually using the Spartan-II-117 fork

In case you still like to use the Spartan-II-117 fork, simply add the following NPM package to the addon configuration like so:

  "npm_packages": [
    "git+https://github.com/Spartan-II-117/node-red-contrib-home-assistant#v0.3.3"
  ],
6 Likes

Hi Frenck,

Thanks for your commitment, I also felt strange when saw those comments.

Although, it seems that the Spartan fork is getting some momentum, there was a PR today. we could keep an eye and see how that develops.

First off, I’d like to say that I am so sorry for the confusion and chaos my fork caused for people, I have released a new version which the api-current-state has been tested to be backwards compatible with AYapejian’s version, but still includes the status indicators from my fork.

This fork was for my own personal use before it was discovered by a Redditor about a week ago, since then i have been trying to find the time to get it up to standards.

I hope some of you find it useful!

5 Likes

@Spartan.II.117
Your fork is great and new contributions are always welcome. Please don’t be discouraged by the first positive and then negative publicity. There are many of us really hoping for a stable, yet actively developed alternative to AYapejian’s version (which, though great, is a bit neglected now).

Backward compatibility would be highly appreciated where possible, as updating numerous flows from ages ago, is a pretty painful task and negatively impacts WAF due to sudden automation failures throughout the house :sweat_smile:

@frenck Thanks a ton for providing the option to still use other forks within the add-on!

@Spartan.II.117 and @frenck thanks for being two stand up individuals who at the end of the day just want to make things the best for all the users and not let any crazy egos get in the way. Its situations like this that definitely make me enjoy and proud to be a part of the HomeAssistant community here! Well done gentlemen!

3 Likes

I would also like to chime in and offer an apology of sorts :frowning: I just wanted to share the fork on Reddit, I didn’t anticipate the amount of traction the post got!

Thanks to the @Spartan.II.117 and @frenck, sorry for everyone’s lost time, and I hope no-one’s WAF was permanently affected.

I am still using the fork as I think it’s great. I’ve just modified msg.payload to msg.payload.state where necessary. Just waiting out the whole current-state node thing until it’s completely finalised.

1 Like

Hi all, I’m getting the following errors: https://www.hastebin.com/hezicafevi.sql
Anybody knows if something is wrong, and what it might be?

Edit: the messages has changed: https://www.hastebin.com/atutahozot.sql
Currently on HassOS 1.7, Hass.io supervisor 116 and Home Assistant 0.74.0.

To manually use the spartan fork, add this to your node-red addon, but remember that it might change whenever the spartan fork is updated. You’ll need to update all your current_state nodes by editing it, removing the last letter and choose the correct entity again.

“npm_packages”: [
GitHub - Spartan-II-117/node-red-contrib-home-assistant-llat: Home Assistant + Node-Red
],

Also, the spartan fork changes how the msg.payload is presented, the payload after a current_state node is “msg.payload.state”, but there are also more information to get from it, like “last_changed” and “last_updated”

Here’s an example of the payloads from a current_state node

21/07/2018, 13:52:06node: 2633ed48.6f65c2
msg.payload : Object
object
attributes: object
entity_id: “input_select.dygn_status_dropdown”
last_changed: “2018-07-21T10:51:07.657639+00:00”
last_updated: “2018-07-21T10:51:49.900134+00:00”
state: “Dag”

Please note, the example might be wrong, since the remote fork updates as well. The example shows v0.3.3 as the pinned version, nevertheless, the fork might be on a newer version already. I know for a fact, that @Spartan.II.117 works/worked on a fix for this, to gain more backwards compatibility. So I would suggest you take a look at the fork and use the latest version which works for you.

Oh by the way, the log of the add-on itself says:
[error] [server:Home Assistant] Error: Request failed with status code 403 over and over again.
172.30.32.2: banned_at: '2018-07-21T12:10:18' keeps getting added to my ip_bans.yaml as well.

Interesting case @tielemans.jorim. I’ve installed the add-on with all the latest and greatest version of everything, but am unable to reproduce it.
Could you provide some more information? Like:

  • are using the new Auth system (which is tech preview)?
  • What URL do you have configured in your Node-RED?
  • Did you manually specify a password for Home Assistant in Node-RED?

@tielemans.jorim PS, this is what your server settings in Home Assistant should look like:

image

No, I’m not using the new Auth system.
image
Currently I don’t even have any flows setup in Node-RED,
just a clean installed add-on a few days ago on a fresh HassOS install.
1 user, default port, ssl and require_ssl true.

By the way, already saw another user with those problems.
Asked him to chime in here this morning: Simple thing, spent hours to no avail

According to your log posted earlier, the “disconnection” was only temporary? (Maybe during Home Assistant upgrade?)

Secondly, you said:

Currently I don’t even have any flows setup in Node-RED

So I wonder, how did you conclude it is not working?

I just wanted to report I have errors, just made a quick flow (tried to toggle/turn on a switch) and can confirm it didn’t work.

Sytem log shows that the toggle service is called:

18-07-21 14:45:35 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/config access from a0d7b954_nodered
18-07-21 14:45:36 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/config access from a0d7b954_nodered
18-07-21 14:45:37 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/stream access from a0d7b954_nodered
18-07-21 14:45:37 INFO (MainThread) [hassio.api.proxy] Home-Assistant EventStream start
18-07-21 14:45:37 INFO (MainThread) [hassio.api.proxy] Home-Assistant EventStream close
18-07-21 14:45:37 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/states access from a0d7b954_nodered
18-07-21 14:45:37 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/config access from a0d7b954_nodered
18-07-21 14:45:37 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/services/switch/toggle access from a0d7b954_nodered
18-07-21 14:45:38 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/config access from a0d7b954_nodered
18-07-21 14:45:39 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/stream access from a0d7b954_nodered
18-07-21 14:45:39 INFO (MainThread) [hassio.api.proxy] Home-Assistant EventStream start
18-07-21 14:45:39 INFO (MainThread) [hassio.api.proxy] Home-Assistant EventStream close
18-07-21 14:45:39 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/states access from a0d7b954_nodered
18-07-21 14:45:39 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/config access from a0d7b954_nodered
18-07-21 14:45:40 INFO (MainThread) [hassio.api.proxy] /homeassistant/api/config access from a0d7b954_nodered

Yeah, that is correct behavoir, since it should… :confused:

As in, the correct calls are made, the reason why the switch is not working in your case… dunno?

I will test this.

Node-RED add-on log show something else now:

21 Jul 16:54:02 - [error] [server:Home Assistant] Error: Request failed with status code 403
21 Jul 16:54:03 - [error] [server:Home Assistant] Home assistant connection failed with error: Connection to home assistant could not be established with config: http://hassio/homeassistant <password redacted>
21 Jul 16:54:03 - [error] [server:Home Assistant] Home assistant connection failed with error: Connection to home assistant could not be established with config: http://hassio/homeassistant <password redacted>
21 Jul 16:54:04 - [error] [server:Home Assistant] Error: Request failed with status code 403
21 Jul 16:54:05 - [error] [server:Home Assistant] Home assistant connection failed with error: Connection to home assistant could not be established with config: http://hassio/homeassistant <password redacted>
21 Jul 16:54:05 - [error] [server:Home Assistant] Home assistant connection failed with error: Connection to home assistant could not be established with config: http://hassio/homeassistant <password redacted>
21 Jul 16:54:05 - [warn] [api-call-service:ad6228ba.003498] Error calling service, home assistant api error
21 Jul 16:54:05 - [error] [api-call-service:ad6228ba.003498] Error calling service, home assistant api error
21 Jul 16:54:06 - [error] [server:Home Assistant] Error: Request failed with status code 403
21 Jul 16:54:07 - [error] [server:Home Assistant] Home assistant connection failed with error: Connection to home assistant could not be established with config: http://hassio/homeassistant <password redacted>
21 Jul 16:54:07 - [error] [server:Home Assistant] Home assistant connection failed with error: Connection to home assistant could not be established with config: http://hassio/homeassistant <password redacted>
21 Jul 16:54:08 - [error] [server:Home Assistant] Error: Request failed with status code 403
21 Jul 16:54:09 - [error] [server:Home Assistant] Home assistant connection failed with error: Connection to home assistant could not be established with config: http://hassio/homeassistant <password redacted>
21 Jul 16:54:09 - [error] [server:Home Assistant] Home assistant connection failed with error: Connection to home assistant could not be established with config: http://hassio/homeassistant <password redacted>

That’s just a part of it but wanted to show logs corresponding with the service call.

Edit: Hm, the ip ended up in the ban list again: 172.30.32.2; I’ll try to remove it and try again.
Edit2: Yeah, just keeps getting added to the list, was considering to add it as trusted_networks but that won’t fix the problem that it can’t login correctly: Login attempt or request with invalid authentication from 172.30.32.2.

HI I also getting the same error.
I have duckdns but Ima using inside the nodered as https://192.168.1.190:8123 is working (loaded) but in the log I can see lot off errors. What that is mean ?

Home assistant connection failed with error: Connection to home assistant could not be established with config: https://192.168.1.190:8123

If somebody has a solution :slight_smile:

Thx Robert.

That is not the recommended setup. You are either using an different add-on, or modified the settings yourself.
That will causes issues and is not supported by this add-on.