So basically every time you change or add an automation the system doesn’t see it until you either restart homeassistant or ‘reload’ the automations.
Configuration > Server Controls > Reload Automations
(prior to doing this use the configuration checker at the top of the same page to ensure that the changes you made are ‘valid’)
You’ll also see the other things that can be reloaded if you make changes to them, anything else that you change whilst the system is running requires the server to be restarted, which is also on the same page (and should also be preceded with a configuration check to make sure that the system will be able to correctly use the new configuration when it comes back up).
I always check config then restart HA after changes but check config then reloading seems better as it’s much quicker so I’ll use that instead from now on.
It seems to be working now so thank you for you help.