There is an Node-red addon for home assistant, see:
It will not work with regular wall switches because they cut off the power to your light bulb. The “regular switch” you are referring to is a hue switch, which can be programmed to do a service call.
In my example my “switch” is an motion sensor (bewegingsmelder hal keuken)
For importing the flow, so you can study and / or alter it and use it, inside of node-red click on the hamburger icon in the upper right corner and choose import. Just paste te code in there and click on import.
It wil just work fine with an hue hub as long as its connected to HA and you can reach the bulbs.
For more info and the basics on Node-red just check the community and the documentation on node red’s website: https://nodered.org
For connecting hue switches from the hue hub to node-red just look for an palette in node-red called node-red-contrib-huemagic