Thanks for the info.
Those i2c sensors look interesting. I will be connecting cat6 wires between the Arduino pins and the existing light switches (removing the mains power obviously) for detecting light switch presses. I don't know of any way to detect the device type here - is there an i2c board for this? (I tried searching but don't know what they're called.)
Or is there some other way to make a simple switch detectable by Arduino?
The reason I chose Mega's is all those pins can detect a lot of light switches and if I add an I2C shield or board it would need to have plenty of pins.
I'm guessing each Mega will have about 50% light switches and 50% other stuff (temp,humidity etc).
RW - I thought about loading something from an SD card whenever the config changes but it's so much nicer to do it over the network. I could even send an MQTT message telling the Arduinos to reload their config.
Of course, I like the idea of auto detecting the devices but I'm going to document all the devices anyway and the decision now is whether those docs are used to config the Arduinos. Doing so would force me to keep my docs up to date.
The MQTT broker does not need to know the addresses of the clients. If the config list includes the mac or IP then each Arduino will only load configs for it's own IP and ignore the rest. Thanks for that link though, nice to know that can be done.