Since Dec 2019 Node Red for HA comes with an additional node called “Sensor” which allows to directly register sensors and binary sensors in HA and push states changes from Node Red to these sensors. To get this to work, you currently still need to install a websocket custom component in HA. It all works beautifully for me. See: