I'm so impressed with my self right now!
It all came together
From registration right through to creating switches in the user's profile, works flawlessly.
Only problem is I had to create a cron job to apply changes by sending a kill -HUP signal to the mosquitto PID in order to apply changes and new mosquitto users, the job runs every 5 mins, this means your new switch will only become available after max 5 mins bit unfortunate but rather that than allowing the www-data user kill external PIDs. Initially I didn't think mosquitto supports kill with -HUP, if you just restart all clients lose connection, got a bit lucky there.
the interface registration and user friendliness is still a bit rough around the edges

It all came together
From registration right through to creating switches in the user's profile, works flawlessly.
Only problem is I had to create a cron job to apply changes by sending a kill -HUP signal to the mosquitto PID in order to apply changes and new mosquitto users, the job runs every 5 mins, this means your new switch will only become available after max 5 mins bit unfortunate but rather that than allowing the www-data user kill external PIDs. Initially I didn't think mosquitto supports kill with -HUP, if you just restart all clients lose connection, got a bit lucky there.
the interface registration and user friendliness is still a bit rough around the edges
