1
0
Fork
You've already forked moat
0
The Master of All Things. Or something along these lines. This is the base repo. At least moat-util is needed.
  • Python 80.6%
  • Shell 14.3%
  • Makefile 5.1%
2024年02月03日 18:23:32 +01:00
bus @dd388efccb updates all around 2023年11月28日 16:21:11 +01:00
dev @4354a79f65 update 2024年01月30日 12:34:25 +01:00
ems @3c7bff54d6 updates all around 2023年11月28日 16:21:11 +01:00
gpio @140341244d Update 2024年01月04日 13:13:03 +01:00
kv @66ca64f35c update 2024年01月31日 11:05:53 +01:00
lib update 2024年01月22日 08:26:00 +01:00
micro @75bdb3004d update 2024年01月31日 11:57:33 +01:00
moat Merge remote-tracking branch 'extern/main' 2023年11月28日 17:01:07 +01:00
modbus @8e23e35ab7 update 2024年02月03日 18:23:32 +01:00
mqtt @b37e3d3d49 update 2023年11月28日 16:51:36 +01:00
signal @b5acd74494 Update 2024年01月22日 08:52:38 +01:00
src @4f573d2439 update 2024年01月22日 08:26:00 +01:00
tests format and lint 2023年04月22日 12:10:57 +02:00
util @de2151de42 update 2024年01月31日 11:57:33 +01:00
.gitignore Update from MoaT template 2023年04月17日 19:33:37 +02:00
.gitmodules Add module "signal" 2024年01月22日 08:25:48 +01:00
HACKING.md trim HACKING 2023年07月17日 08:33:28 +02:00
LICENSE.txt add toplevEL LICENSE.txt 2022年09月14日 12:56:17 +02:00
Makefile Add a Makefile dammit 2023年04月17日 18:26:16 +02:00
mt Merge remote-tracking branch 'extern/main' 2024年01月24日 11:11:28 +01:00
pyproject.toml Update MoaT requirements 2023年05月18日 14:42:43 +02:00
README.md README update 2024年01月22日 08:52:14 +01:00
requirements.txt sorted requirements 2023年02月19日 16:33:08 +01:00
setup.sh wrong Python module for git support 2023年02月19日 16:34:05 +01:00

The MoaT

"MoaT" is an acronym of "Master of all Things", which is either aspirational or just plain pretentious. Take your pick.

If you assume that this repository contains the same stuff as a regular moat, i.e. a lot of water of questionable quality (plus whatever the castle's inhabitants wanted to get rid off), you might not be too far off the mark.

Well, except for the water.

Seriously ...

The MoaT code comprises a lot of somewhat-opinionated code to control various IoT devices. Among those are photovoltaics, irrigation, door intercoms, and whatnot.

The core of MoaT is written in anyio-compatible asynchronous Python3, written with Structured Concurrency principles in mind.

Satellite microcontrollers typically run MicroPython, again heavily using structured async code: MicroPython supports taskgroups if you patch it lightly.

Structured what?

Structured Concurrency.

There's a Wikipedia article about it.

A good Pythonic introduction is here.

Repository Structure

The MoaT code is built using git submodules, corresponding to separate moat-XXX packages.

The top module contains the command-line front-end of MoaT. Any MoaT code that can reasonably be controlled by a command line hooks into it, by way of a _main module with a cli object, which should be an asyncclick group (or command).

The only mandatory submodule is "util". It contains a heap of semi-structured helper code which the rest of the MoaT infrastructure depends on. "moat-util" also has a command line; it serves as a convenient example for building your own extension, and exports a time-until-absolute-date calculator and a msgpack codec.

Modules

Components

  • dbus: an async DBus client.

  • gpio: a library to read and write GPIO lines.

  • modbus: an opinionated Modbus client and server library.

  • mqtt: a MQTT broker, client library, and client command line front-ends.

  • wire: a bidirectional link exchanging structured messages, with backends for serial and TCP.

  • micro: Support for MoaT sattelites running MicroPython

  • kv: distributed masterless eventually-consistent key-value storage.

  • ems: Battery management, photovoltaics, ...

  • src: MoaT source code management

  • dev: support for specific devices

Support Libraries

  • pid: a PID controller with anti-wind-up, saveable state, bumpless transfer, and measurement noise suppression.

MoaT-KV components

Moat-KV is a master-less distributed key-value storage system. It is resistant to partitioning and intended to be always-on. It will not block or lose updates in a partitioned network; inconsistent entries are re-synchronized upon reconnection.

"moat.kv" is currently named "distkv". Conversion to MoaT is planned.

  • akumuli: Data storage to Akumuli, an efficient light-weight time series database

  • gpio: Connecting Moat-KV and MoaT-GPIO

  • hass: Use MoaT-KV as the MQTT back-end to Home Assistant

  • inv: Network inventory management (hosts, networks, VLANs, links between hosts)

  • knx: Link with KNX building automation networks

  • owfs: Connecting 1wire sensors

  • wago: A rudimentary interface for WAGO 330 controllers

MoaT-EMS components

EMS is an acronym for "Energy Management System".

  • battery: Battery management

  • inv: Inverter management

  • sched: Energy storage scheduling

More will follow.

MoaT-dev support

  • heat: example for controlling a home's heating system (heat exchanger, pellet boiler, buffer for hot water and radiator-based heating).

Support

Supporting MoaT is possible via Paypal or bank transfer (DE34430609671145580100, GENODEM1GLS).

Direct support via email or Zoom/Teamviewer is also available. Contact Matthias Urlichs for details.