Regarding the local storage Vs server side defaults I don't understand why you wouldn't use a web cookie to store the on/off state? Am I missing something
Also, because of cookie banners, they got a bad reputation even though most countries allow you to store non personal data. Even just data that is necessary for the functionality of the website doesn't need permission.