In the informatics programme at our school we run a module on home automation, of course using Home Assistant. Over the last iterations we have been struggling to find a good setup to give students the ability to actually build things in Home Assistant, sometimes having to resort to an alternative paper assignment if our setup breaks down, which is of course a major letdown. I'll describe the evolution of our setup and some of the things we have tried below, but I'm curious to hear how you would set this up (or have set this up, if you happen to do something similar!).
We'd like to facilitate about 10 groups of 2-3 students, each working on their own system. They are in a single location, spread over at most a few classrooms.
We started with a single Home Assistant server, to which all students could connect devices and on which they could build their automations. This became quite messy and students easily interfered with each other, either accidentally or on purpose.
Then we moved to running separate virtual Home Assistant instances in containers on a single machine, connecting the devices through multiple Zigbee dongles. Managing multiple servers takes some work beforehand, but ensures that every group has their own space without stepping on each other's toes. There was still an interference problem though: Zigbee connectivity is incredibly unstable with multiple dongles connected to a single machine.
Spreading this out over multiple physical hosts, each running two Home Assistant instances in containers and with two Zigbee dongles improved this a little. Due to the room setup in our last iteration the hosts ended up quite close to each other, but even with some physical distance, the setup seemed a little unstable.
The next step would be to test again with more physical distance, manually making sure that the Zigbee networks run on separate channels and maybe moving to a single Home Assistant instance per host, but at this point we are starting to reconsider if this is still the way to go...
Questions:
How would you run (and especially initialize) multiple Home Assistant servers? Dedicated hardware for each? Virtual machines, so they can be cloned after initial setup? Containers?
What connectivity would you use for devices? Would you try to make Zigbee work? Has Thread made improvements in this regard? Is Z-wave more stable in an environment like this? If choosing Wifi, would you go with a separate network (virtual or physical) for each group?
I did not do this in a classroom environment, but I think my solution would work for you.
I run Zigbee2MQTT and Z-Wave JS as independent VMs outside of Home Assistant. In Zigbee2MQTT I set Home Assistant discovery topic to 'homeassistant' and set it as Enabled with Home Assistant experimental event entities enabled as well. In Z-Wave JS I set the Home Assistant WS Server to enabled.
Home Assistant will auto-discover both if they're on the same subnet. Z-Wave will be recognized as a Z-Wave integration, and Zigbee2MQTT will be recognized as MQTT integration.
You should be able to connect as many instances of HA as you want since HA will only be "talking to" these external servers rather than controlling them directly.
I used to run both Home Assistant and HomeSeer HS4 both pointing to my Z2M and Z-Wave JS external VMs. Never had a problem.
Thanks for the suggestion! A shared Zigbee2MQTT instance might indeed be a good solution to prevent many coordinators trying to scream over each other.
Looking at the Mosquitto documentation, we might even be able to use the Dynamic Security Plugin to dynamically make devices available to each instance, if that turns out to be necessary. I'm not sure if something similar is possible with Z-Wave JS, but since we already have mostly Zigbee devices, I'm thinking we'll stick with those if this works.
I'd avoid Zigbee like the plague for this and go esphome. Reason you want to teach theory not fight config. Imho in your environment you will ALWAYS be fighting config with zigbee purely from the interference perspective. Just make it a non issue.
You can use the fact that zigbee isn't suited to a high interference environment as a lesson in the discussion and include it in the talk about the difference in protocols. (also a lesson chose an appropriate transport for the job. Zigbee isn't suited to high 2.4g energy environments)
With esphome you can either prebuild your exemplar device for lesson or make the build a lesson in itself depending on the learning objectives...
Also I'm an ex educator and senior sales architect for a large education technology company (and do this for schools on a regular basis. Usually with AI.) If you need more help with building the demos and lessons reach out in DM.
Out of curiousity (mine, and a student will definitely ask at some point ): what makes Zigbee less suitable than Wifi in an environment that is indeed quite busy in the 2.4GHz spectrum. Radio-wise they share the same frequencies, so on that basis I wouldn't expect there to be much difference. Is there something in either protocol that makes Wifi better than Zigbee at dealing with a lot of chatter?
Imagine I have an air horn. One of those attached to an air can
...and you're standing next to a cruise ship in the port at Cozumel.
I walk up and start to blast it point blank in your face, about the time you get mad and start to yell. The cruise ship starts to blast it's air horn array... Suddenly both of us are deafened temporarily...
Yeah that's the sheer difference in relative power for WiFi compared to thread, zigbee Bluetooth and matter. Wifi is a cruise ship. The rest are various horns... Lots of them btw. But Wifi will ALWAYS drown out the other from sheer power.