Node-red-contrib-home-assistant-websocket

Is there a way to remove the node-red-contrib-home-assistant node?

1 Like

If you are asking how to remove it after replacing it refer to mine comment above. Otherwise not exactly sure what youā€™re asking.

Even with all flows deleted and the node disabled the remove option is not there.
17%20AM

@Picnic I had that problem, I think I just restarted node-red (docker) and it would allow me to delete it.

Iā€™m also running node red in a container using the latest node-red-docker:rpi-v8 image and have got the same websocket problem. However Iā€™m struggling to update Node to 8.12.0 as you did.

Can you please explain how to do that?

Thanks

Iā€™ve had success with version 0.0.7 of this plugin. For 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.

Under Hamburger menu->ā€˜Configuration nodesā€™, make sure you donā€™t have unused nodes (with doted lines) that say: ā€˜Home Assistantā€™ ā€“ those actually use the plugin. Delete them, deploy, and your palette should have the ā€˜removeā€™ button for the plugin enabled.

Iā€™m not at my computer right now, but as I remember I ssh onto my RPi, and opened a bash terminal inside the docker container. Then I installed ā€˜nā€™ via npm and think the final command was ā€˜n install 8.12.0ā€™

I hope this can her you closer

Iā€™ve already replied to you on github about this but replying here also for the people who donā€™t see it there.

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.

Just tried the init command and it didnā€™t work for me. For now iā€™m using the notoriousbdg version of node red and itā€™s working well.

Yes, my instructions for using node-red-contrib-home-assistant-websocket with hass.io are based on the community version of the addon-node-red. I wasnā€™t actually aware that there were two different add-ons for node-red for hass.io. According to the Github repo for NotoriousBDG version, it has been deprecated.

I have Installed ā€˜nā€™ using npm install n. When I type n install 8.12.0 I get bash: n: command not found

Any idea on how to solve it?

I had the same issue , and tried all of purposes , but finally removing the ā€œDNSMASQā€ addon solved problems.

Is it possible for you to let us know what changed about the formatting of ā€œcurrent stateā€ and ā€œpoll stateā€?

I have your fork up and running and it seems to be working great, but I have a lot of flows and not exactly sure what I should be checking for.

+1:

@Kermit : Please add a format section in your documentation and advise when there is a format change. I as well have a lot of flows using these nodes.

Great work ā€¦ keep it going :+1:

Current-State Node Output

Unchecking ā€˜Override Topicā€™ and ā€˜Override Payloadā€™ doesnā€™t work in node-red-contrib-home-assistant v0.3.2. It always overwrites msg.topic and msg.payload. If you have current-state nodes where you have unchecked the ā€˜Override Payloadā€™ with node-red-contrib-home-assistant-websocket it will stop overriding payload and put the state object into msg.data

Poll-State Node Output

msg.payload.data moved to msg.data

msg.payload becomes just the state of the state object msg.payload.data.state => msg.payload

msg.payload.dateChanged removed

msg.timeSinceChanged and msg.timeSinceChangedMs moved into msg.data

node-red-contrib-home-assistant v0.3.2

{
  "topic": "sun.sun",
  "payload": {
    "timeSinceChanged": "4 hours ago",
    "timeSinceChangedMs": 15342567,
    "dateChanged": "2018-10-11T14:21:01.004Z",
    "data": {
      "entity_id": "sun.sun",
      "state": "above_horizon",
      "attributes": { ... },
      "last_changed": "2018-10-11T14:21:01.004183+00:00",
      "last_updated": "2018-10-11T18:36:30.002985+00:00",
      "context": { ... }
    }
  },
  "_msgid": "345fd403.6e71ec"
}

node-red-contrib-home-assistant-websocket v0.1.1

{
  "topic": "sun.sun",
  "payload": "above_horizon",
  "data": {
    "entity_id": "sun.sun",
    "state": "above_horizon",
    "timeSinceChanged": "5 hours ago",
    "timeSinceChangedMs": 16236433
    "attributes": { ... },
    "last_changed": "2018-10-11T14:21:01.004183+00:00",
    "last_updated": "2018-10-11T18:51:30.002737+00:00",
    "context": { ... },
  },
  "_msgid": "5071255c.ad802c"
}
1 Like

Did you fix this? canā€™t get it to work either.

I switched to this version as I had some general errors and wanted to try something else. Not sure this is related but in the old version I choosed my node and the domain and service showed up automaticly in the drop down list. Now I will have to type them in manually. Is there anything I have done wrong? Do you have them populated automaticly?

you need to use

npm install -g n

and than

n 8.12.0

@Kermit Just installed Node Red Docker v0.19.4 on a RPi3 installed Node-red-contrib-home-assistant-websocket v0.1.1
and cant connect to HA.

I am using a long lived token and http://192.168.x.x:8123. without the use Use Legacy API Password unticked.

The error in Node red is

"RangeError: Invalid WebSocket frame: RSV2 and RSV3 must be clear"

And

"Error calling service, home assistant api error"

The error in HA log is:

INFO (MainThread) [homeassistant.components.websocket_api.http.connection.140653592047744] Connection closed by client

Any help please.