!QhvgabMQzwEQeWehhZ:lossy.network

NixOS Home Automation

506 Members
Declarative Home Automation and other Sidequests | https://wiki.nixos.org/wiki/Home_Assistant132 Servers

Load older messages


SenderMessageTime
19 Jun 2021
@instantepiphany:matrix.orginstantepiphany
In reply to @linus.heckemann:matrix.mayflower.de
What's the use case for RTSP?
Security camera streams is what I have in mind.
07:00:19
@linus.heckemann:matrix.mayflower.deLinux HackermanAaah08:03:31
@schnecfk:ruhr-uni-bochum.deCRTified instantepiphany: do you want to rely on something hue specific, or on zigbee2mqtt for that? 10:06:49
@schnecfk:ruhr-uni-bochum.deCRTifiedOne non-mvp feature that's important would also be logging10:09:13
@schnecfk:ruhr-uni-bochum.deCRTified
In reply to @instantepiphany:matrix.org
Any thoughts on the name “Automation Station” for a new NixOS home automation service? No home in the title 😌
Yeah, something like automation was also in my mind. For a nix-specific one I was thinking about "Automationix"
10:10:45
@schnecfk:ruhr-uni-bochum.deCRTifiedIn the end, it's just a working title right now10:11:10
@instantepiphany:matrix.orginstantepiphany
In reply to @schnecfk:ruhr-uni-bochum.de
One non-mvp feature that's important would also be logging
Agreed!
10:29:48
@instantepiphany:matrix.orginstantepiphany
In reply to @schnecfk:ruhr-uni-bochum.de
instantepiphany: do you want to rely on something hue specific, or on zigbee2mqtt for that?

In my mind I want to support as many "targets" as possible. I've only got HUE devices listed in MVP because I own some, so I can test them. So if there is a specific way of communicating that is broadly applicable to more targets of other brands, then we should consider that. I'll keep zigbee2mqtt in mind.

From reading HA docs, it seems that HUE only allow group control via "Scenes" which eventually get purged if not used for a while. So will have to look at a good way to handle that. IMO the more information stored in our system, and the less on target onboard memory, the better.

10:31:53
@schnecfk:ruhr-uni-bochum.deCRTifiedI think that zigbee2mqtt is the best way of handling most of these devices, as it's easy to access (mqtt, which should also be a nice first automation goal), is already well established and nicely maintained and has an insane number of supported devices10:34:06
@schnecfk:ruhr-uni-bochum.deCRTifiedMQTT is already a protocol/platform that works nicely with many devices (esphome interacts with it, too), it "only" misses nice UIs and automation AFAIK 10:36:38
@instantepiphany:matrix.orginstantepiphanyGreat, I'll look at mqtt as a first protocol to support.10:38:37
@instantepiphany:matrix.orginstantepiphanyThanks for the info :thum10:38:45
@instantepiphany:matrix.orginstantepiphany * Thanks for the info :thumbup:10:38:54
@instantepiphany:matrix.orginstantepiphany * Thanks for the info!10:39:05
@robert:funklause.dedotlambda I think the core of a home automation should be some automation engine, not protocol support or anything. Fancy dashboards, even ones that act on button clicks, can be hacked together really fast and don't need such an engine. 13:27:05
@schnecfk:ruhr-uni-bochum.deCRTified
In reply to @robert:funklause.de
I think the core of a home automation should be some automation engine, not protocol support or anything. Fancy dashboards, even ones that act on button clicks, can be hacked together really fast and don't need such an engine.
But you need some platform for testing and developing that automation engine
13:27:45
@hexa:lossy.network@hexa:lossy.networkautomation engine = event bus?13:27:52
@robert:funklause.dedotlambda
In reply to @hexa:lossy.network
automation engine = event bus?
Kinda, I guess. I think that's where existing solutions could maybe be improved. The more devices you have in your home that report data, the less feasible it is for every automation you wanna script to listen to all events, which are mostly state changes. So if I were to design such a system, I would take good care to have every automation define the events or data points it cares about. Let's say some heating automation cares about outside temperature (now and prediction for 1h, 2h, ... from now), inside temperature, people present, ... Then that automation should only be triggered when one of these states changes.
13:34:25
@hexa:lossy.network@hexa:lossy.networkright, I think at the core there needs to be an event bus, maybe something pub/sub, and everything that hooks into it needs to follow a certain interface, so there is a generic way to talk to certain device classes13:34:26
@robert:funklause.dedotlambdaAnd also, I think defining automations could benefit from pure functional programming to avoid recomputing stuff if the changed states don't make a difference in some interim step in the computation, so some type of memoization.13:36:00
@robert:funklause.dedotlambdaTo sum it up, everything should be very declarative and functional :)13:37:16
@robert:funklause.dedotlambda* And also, I think defining automations could benefit from functional programming to avoid recomputing stuff if the changed states don't make a difference in some interim step in the computation, so some type of memoization.13:47:27
@instantepiphany:matrix.orginstantepiphany

Just to clear something up - what I listed as "MVP non-features" means I won't be doing those as part of the MVP - I definitely think they add value.

My end goal is for this project to be installable by an end user (though of course a NixOS end user is certainly more likely to be technically minded) and provide all that the user needs to automate IoT devices in their home, though different devices will need specific plugins.

So the first thing to build, because everything else depends on it is what I called the "service" - this is the backend that actually communicates with the devices (targets) on one end, and a HTTP request on the other end.

Then, once this service is working, a web interface, or app interface could be built to present things in a more friendly manner.

So in the end the scope is quite large, much like HA, however for the "MVP" I just want to work on the service.

By the nature of IoT, different plugins that support different targets will require different protocols - HTTP, RTSP, MQTT, etc, so we can't really choose just one. Given MQTT supports many devices, and I have used it a little in the past, it seems like a logical place to start.

So the "core" would be the service, but more is definitely required for a complete solution. Though, it would be nice if someone could just install the core, and build their own frontend if desired.

Regarding architecture, specifically how people have mentioned event buses, pub/sub, I suspect that pub/sub would be an ideal candidate, though am very open to all suggestions! I think pub/sub is the simplest way to describe what happens - events happen, a camera seeing motion, a light turning on, or losing connection, an IRC message mentioning the user, etc.

So various pub/sub messages would be published, and some kind of logic engine in the service would subscribe to some of them, possibly generating "actions" in response, depending on the users configuration. So we could avoid the situation where an "automation" would have to process irrelevant events. This is one thing that I think redux-observable presents a really nice development experience for, which is why I have been describing "actions", which is the term they use.

Finally, regarding functional programming, I agree there are potential performance gains to be had via memoization, though I suspect that would only surface for large scale systems (say, more than 30 messages per second). I'm a big fan of measuring before optimizing, so while I think we should keep memoization in mind and build a system that would be easy to memoize, we shouldn't memoize things until we actually have performance issues.

With an event system such as pub/sub, it is not difficult to create crude approximations of that kind of heavy load, that will be a fun exercise :)

I was tempted to write this in Haskell, but I've never worked with high performance Haskell before, and suspect Rust will be more approachable for more people to contribute. Does anyone have any comments on language choice?

14:02:16
@schnecfk:ruhr-uni-bochum.deCRTifiedRust is probably better for a project that might eventually rely on a bigger dev group to contribute 🙂 I know neither well enough (did more in haskell than in rust), but I'd be willing to do more/anything with both 14:06:38
@instantepiphany:matrix.orginstantepiphanyI suppose considering a web and app client are desirable we will end up having multiple languages and able to take contributions from many more. For the web interface, there might be a chance to use Elm, which isn't Haskell but is functional and may lend itself to staying in the functional paradigm as much as possible. 14:09:21
@schnecfk:ruhr-uni-bochum.deCRTifiedI'd prefer to not use Elm for the frontend, but that's highly opinionated. Purescript might be the better alternative14:10:15
@instantepiphany:matrix.orginstantepiphanyI've been doing some research regarding rust on mobile (iOS and Android) and apparently it is quite simple to setup a toolchain where you use rust for core functions (in our case checking configurations) and the only platform specific code is for the UI, and even then something like Flutter can be used to have the same codebase for both. 14:11:05
@instantepiphany:matrix.orginstantepiphany
In reply to @schnecfk:ruhr-uni-bochum.de
I'd prefer to not use Elm for the frontend, but that's highly opinionated. Purescript might be the better alternative
I've never used it, just saw the documentation and thought it looked decent. I don't have any opinion here, my frontend is limited to JS/TS, Angular/React.
14:11:51
@schnecfk:ruhr-uni-bochum.deCRTifiedThat's more frontend that I've done, but there was some problem where the maintainers of the elm project basically crippled the functionality of all libraries that relied on non-elm (js) bindings - except their (afaik optional) libraries. I'll try to find that blogpost again, but the general vibe I got in the armbee reminded me somewhat of that problem14:14:51
@schnecfk:ruhr-uni-bochum.deCRTifiedThis covers some of the problems that I've read about elm: https://lukeplant.me.uk/blog/posts/why-im-leaving-elm/14:15:52

Show newer messages


Back to Room ListRoom Version: 6