How to trigger a flow in node-red from HA lovelace ui?

Do you have the custom integration installed in HA?

I have seen that mentioned. But its very confusing. So basically you can have the nodes installed as part of node red supervisor add on instal. But this node wont actually do anything without this add on that needs to be installed in from the HACS store?

Thats weird?

Ahh ok

image

I just started comparing the node doco and seen this and the link. Ok got it!

Thanks Kermit :slight_smile:

First of all, thanks Mike for this tip!

It took me FOR EV ER to get things installed but now I have added an entity node in NodeRed. I deployed. The node says ā€œregisteredā€ under it with a date and time. But I cannot find it in Entities! Am I dumb or something something wrong?

Did you ever figure this out?

So I wasnā€™t reading it properly before, hence not understanding that it needed the companion part installed from HACS.

Thatā€™s done,

image

But I still canā€™t create entities using this node.

image

It should be as simple as adding the node and hitting deploy? Or am I missing something else?

Thanks guys :slight_smile:

I had an old draft saved with this info, It might help you.

BUT!!!

In the end I used an input Boolean because the entity never appeared for me

1 Like

If you want to create a switch or sensor inside HA youā€™ll need the HACS add on. Then add it to your integrations.

image

You will see the node red companion, your entities can be found here.

image

1 Like

I have 3 switches here to change a profile in blueiris by mqtt flow in nodered.
Now Iā€™m wondering how to make one switch turn off if another one is turned on.

Daytime and Home profiles cannot both be on, If Home is on then Daytime needs to be OFF in homeassistant. Tried to insert OFF to the beginning of the nodered entity but did nothing in HA.

Had to add an extra call service on the on output to switch the other off. Maybe can only be done this way. Bit messy though

image

I understand you want to achieve something like radio-buttons do, isnā€™t it?
Then turning one on, then intercept this in NR in order to turn off other ones is not an option because more switches will be turned on at the same time for a fraction of second

I recently started to use svc2evnt HACS addon (you need to add its repo to HACS). It allows to generate an event (with customized data). You can intercept this event in NR, then make needed actions (disabling all switches, enabling one).
Not sure itā€™s doable with vanilla lovelace. Iā€™m using custom button card which is capable to call services (incl triggering events)

In fact this method (svc2evnt) is very powerful and usefull, allowing you to inform NR about various things without need of creating intermediate switches or sensors.

1 Like

Thanks Iā€™ll have a look into that later.
I have managed to achieve what I needed today, but messy and time consuming.

Hey, thanks for the information.

Is there any option to send data from an input or slider? I want to define a time value through a slider and start then the flow with the value. Is is possible and how?

Iā€™ve got the NR entity node configured as a switch. It has 2 outputs. When I run an Automation that turns the switch on or off (service: Switch: Turn on/off) it works and the text under the node shows that. So far so good.
The problem Iā€™m having is that I then want it to trigger the next node which sends a Notify to my Amazon Echo. But nothing is coming out of the Switch node.
I have confirmed the Notify node works with a Timestamp inject.
I have attached a debug node to the output of the Switch node and it shows nothing.
What am I doing wrong?

image

Check that box

edit: left out the important part. Set the output to J;expression and use

$entity().state ? "on":"off"

On the NR Entity node set as a Switch, there is no such check box.

It does

See if that loads

[{"id":"92cde6be82930449","type":"ha-entity","z":"f80b6c338afd5483","name":"","server":"6b1110b5.183a4","version":2,"debugenabled":false,"outputs":2,"entityType":"switch","config":[{"property":"name","value":""},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":""},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"msg","inputOverride":"allow","outputOnStateChange":true,"outputPayload":"$entity().state ? \"on\":\"off\"","outputPayloadType":"jsonata","x":550,"y":500,"wires":[[],[]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]

If not are all your components up to date? Nodered companion(hacs),NR addon, and ha nodes( goto manage pallete and search websocket. Look for the HA nodes in the list and click update if available.

If that does not yield results remove and reinstall. Backup flows and NR. Stop NR, remove NR, goto /config rename folder to node-red.old. Reboot the sysytem ā†’ settings, hardware, pi, three dots top right, reboot host. Or however you reboot your hardware at an os level. Then reinstall.

Ah, They were not up-to-date but are now!
Yes it works now with a trigger coming from the top output when turned on and the bottom output when turned off. So the conditional is not needed.
Thanks.

Thanks for the sample, I was trying to do the same and got it working. Now I wonder how can do the same by clicking on the HA actions? I use HA action defined in the configuration.yaml and the event actions on done in node-red, but not sure how to do this. any help would be appreciated. Thanks.

Hello to all. Thank you for this tips, but Iā€™m stuck and canā€™t go on. I installed the add on from HACS and created a button on my lovelace

with this button Iā€™m going to call this flow that I have in my node-red
foffo

which is a physical button that I have in my living room (FLIC button) that turns on or off some lights when pressed.

My problem is that it is not clear to me how to set in node red type switch

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/node/switch.html#examples