Well, this is just plainly naive, isn't it? What about all the infrastructure and energy required to run all the cloud functionality?
That is a really good point and one I have not thought about.
A very quick web search seems to show that 1 TB of data uses between 40 and 70 kWh/year.
If each 'user' has 1 GB of data, that is around 0.055 kWh/user.year, or 6W.
A Raspberry Pi, running headless uses about 3 W, with a bit of tuning, about a watt (what mine uses.
An ESP**** about a tenth of that.
To that figure, the energy usage of 'smart switches' needs to be added, regardless of if it is cloud or locally connected.
Another quick web search gives a result of 1W for a Shelly Relay.
So that could be another 10W for a few connected devises, or ~90 kWh/year.
With a cloud connected service, the energy usage of the data transport has to be taken into account. So a local router, a share of the local telephone exchange (or 4/5G), 3 to five internet servers etc.
So it is probably cheaper to use a local service, that is hard wired if possible, but not as good as a manual switch.
Food for thought.