I originally worked with basic mqtt integration until Rob (gizmocuz) gave me some help on the scripting for our Victron based home battery builds and decided to base everything on AD. Since then, that has been the basis for any integration I do with node red.
The principle is quite simple:
- the startup function defines all the devices as well as sends all the AD messages
- the domo mqtt ad flow processes all these and sends them to mqtt
- in your flows, you can listen for any command for any device and act in any way you want but remember to report back the result as, otherwise, domoticz won't see the change
I have put some examples of my integrations on https://github.com/heggink/domo-nodered. Clearly, you need to install the underlying integrations in node red (menu->manage palette->Install e.g. node-red-contrib-tuya-smart-device, node-red-contrib-car-bmw, similar for the shell new motion API).
Some of these scripts can probably be improved and optimised although I am completely out of bandwidth to do that ATM. Suggestions are welcome as are questions.
H