I mentioned that I want to build a (simple) Smart Home System.
While a shower I had another idea: why not use an ECS as core component?
I see some similarities. Instead of game objects I have sensors and actors. But they have components, they create events and trigger some actions. I just don't render graphics to a screen.
Is this a stupid idea or could this work? I just have a general idea how an ECS works, but I never used one in a project.
bevy_ecs is a separate crate and is really straightforward to use - doesn't include any rendering code.
However, @ZiCog raises a good point - the reason games use ECS is because it's a transformation of data composition (array of structs -> struct of arrays) that improves cache locality and thus performance when batch processing large number of components (100+ per type).
Given that you'll likely only have ~10 types of a single device in your home, ECS introduces a lot of complexity and offers very little in return.
A couple of structs, a trait and a loop in the main would suffice for your use case. If you have a device that would block the execution for a longer period of time you can use threads or an async runtime. I think the async route with structs implementing actor-like trait would be most ergonomic to use and you're unlikely to notice <200ms delay (which is probably an overestimate).
I am using bevy_ecs for a 2d visualization project I am doing, with a custom renderer. A lot of bevy_* crates were quite handy.
It is still at early stages so hard to say where it is going to be a successful endeavor, but one aspect I quite like is how the system/plugin can be external and behaviours are just plug-and-play without having to deeply nest them in-between.