Check entity state inside function node

I have a function node like this:


And a home assistant entity like so:
image
I need to add an if/else condition in this function that checks the on/off value of the home assistant entity but not sure how to call it inside the function node, can someone advise?

There are limited people on here who use NR and HA - you would be better off asking this in the NR subforum on the HA official forums.

Craig

Is the entity in the message going into the function? If so there’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

If you can't make it work then use the copy path button described above to copy the message contents and paste it here so we can see what is there.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.