Node-red-contrib-home-assistant-websocket

Ooooh, “in group”, thank you very much!

I’m struggling with relative time for the get history node. Even entering the example of “20 minutes” gives me the following output.

"value" must be a number of milliseconds or valid date string

Fix released in v0.6.1

1 Like

Thanks. It’s working well. That’s a great change which means I can remove function nodes that I was using calculate the time 60 seconds ago :slight_smile:

1 Like

Looks like the server-state-changed node flag Output Initially / On Deploy doesn’t trigger when only doing a partial Deploy like Modified Flows or Modified Nodes even when that node is within a modified flow or is a modified node.

Yes. I haven’t had a chance to look into it but you can follow its progress below.

Hi, curious question, is this only to be used with hassio? I’m trying to set this up with duckdns and https and I’m getting a message that says invalid format of base URL: Undefined. is anyone else experiencing this?

There’s a hassio addon that allows this to work with hassio but this is a stand alone package that works with Node-RED. Sounds like you don’t have anything in the Base URL field.

New Release v0.7.0

Bug Fixes

  • Added a check for valid server (66d8daf)

  • Fix for nodes to trigger on deploy (8205236), closes #80

  • trigger-state: Fix to show the correct properties for constraints (62e22fa)

Features

  • current-state: Added customizable outputs for state and entity (0a51c5d)

  • event-state: Added “Only output on state change” (0707d72)

  • wait-until: New ‘Wait Until’ Node (6717972), closes #82


Buy me a coffee For those that enjoy my work.

3 Likes

event-state: Added “Only output on state change” (0707d72)

does that eliminate the need for an RBE node after the event node?

Correct, when checked the node will only output when the new_state.state does not equal the old_state.state.

Thanks Kermit, you are killing it! Good job mate.

Hai there,

Thanks for your excellent work ! that wait-until node is helping me having simpler flows :slight_smile:

I have an issue : i’ve deleted input_boolean.all_lights and created a input_boolean.bright_lights in my home assistant, i’ve restarted and it’s working fine on home assistant end.

On node red on a “events: state” node i keep seeing the old input_boolean and not the new one. If i update manually with the current one i do not get an error on Deploy, but i do not have the events either.

Is this issue known ? maybe something to fix ?

Thanks !

I restart Node-RED whenever I add or delete devices on HA so it refreshes its entity list.

I almost never restart Node-RED, and my devices show up after I add them to HA

1 Like

Hi, I’m stuck…
I had the old homeassistant node working, but not able to get this new websocket version with long lived tokens to connect.

Home Assistant Docker

  • :latest
  • Network host

added logger for websocket

base_url: sub.domain.com

create a long lived token for node-red

Node-Red Offical Docker

  • :v8
  • Network host

added base url and token to the node settings
results with node not connection and nothing in logs

adding :8123 to the end of base url
results with node showing connecting and nothing in logs

after every config change I restarted both HA and Node-Red and cleared cache…

These dockers are behind a pfsense box with haproxy and acme configured.

The domains display correctly with https

I feel there is a coding issue to force ssl as i’ve had this issue with “mixed connection” before
with websites…
so http and ws are being used instead of https or wss.
Not 100% sure atm.

found out that I was missing websocket_api: from ha config…
So I now can see auth errors in logs…
And I’ve setup a websocket client that I can connect with ws://IP:8123/api/websocket
Send Auth and connect…
But I cannot get this projects node to do the same…

http://ip:8123 within the nodes base_url was the work around https:// not working…

Are you using SSL offloading with HAProxy? If so your base url should just be using http://ip:8123.

What do the error logs show?

“wait-until” node is wonderful, but two questions:

  • if I “wait untill” status of a mediaplayer is on, it works if mediaplayer status switch from off to on. If it is already on, node goes in timeout. It isn’t the beahviour I’d expect.
  • if I call a service after “wait until”, “call service” node uses payload info for calling service, whatever domain/service/entityid/data I put in “call service” node. I have to delete msg.payload before “call service” node. Maybe an option for claring payload after “wait until” check?

Thx for your WONDERFUL work!

Yes, I think adding an option to check the current state or not is a valid enhancement.

The wait-until node isn’t injecting anything other than the entity defined in it and only if you choose to do so. So the payload information is from upstream and should be handled upstream. What does your flow look like in this use-case, are you calling a call-service node before the wait-until node?

Wonderful. Now I have to check current state outside, and I miss wait until node easyness :wink:

Yes, problem is call service node. It seems to ignore what you write in the node if there is a payload with entity id and service incoming. I have to delete payload before entering service node