HA with Node-RED for PLC control

Hello everyone!
I am playing with integrating HA with ClickPlus PLC via MQTT.
I have already established an MQTT connection. I can subscribe and publish to mosquito broker on NodeRED and PLC side
On the PLC side, I have logic for a simple light switch.
Now I want to create a switch in the HA dashboard, that when pressed, NodeRED will publish data to the broker to which PLC is subscribed and will change the output state based on received data.
I am quite a beginner with HA and have no idea how to approach the problem. Can’t find a way to create a custom entity.
Any help is much appreciated.


I’m not entirely sure what you’re trying to do :slight_smile: but this might help point you in the right direction.

An entity node will let you create a switch in home assistant, you can use that to trigger your MQTT messages, it’s a switch so it’ll show as on or off in HA.

You could also create a “toggle helper” in HA and monitor that from Nodered for an on/off state, or create a “button helper” in HA for a momentary switch.