summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2 daysREADME.md: Add build instructionsxengineering
2 daysDeploy README.mdxengineering
This information is useful in the deploy tar archive. Thus it is copied there.
2 daysAdd README with description and hardware supportxengineering
2 daysDo not print start banner on usagexengineering
Before this commit the start banner `+++ Started Sia server +++` was printed before the usage instructions. The stop banner was not printed. The intended behaviour is to print none of them. This is not implemented.
2 dayssystemd: Add service and sysusers configuration filesxengineering
This makes it possible to run the Sia server executable on systemd-based Linux distributions with systemd making system administration easier. Maintaining these files in the source instead of packaging repository was decided since systemd is the dominant init system across Linux distributions and thus not every distribution-specific packaging repo needs to re-invent the wheel.
2 daysDeploy default configurationxengineering
The default configuration from the source tree is embedded into the executable with Go's embed package to assume the correct defaults. Furthermore it is now also part of the artifact tar archive to give users an idea how a configuration file should look like.
2 daysAdd Meson-tracked project versionxengineering
This allows to use the version of the project in the build system independent from the version control system. Thus a source tar archive can be built the same and also changing the version control system does not change anything regarding the build process.
2 daysconfigs: .gitignore: Add `debug.json`xengineering
This is reserved foooooooooor local development.
2 daysAdd tar archive generation for deploymentxengineering
Bundling all build artifacts into one tar archive is good practise to make deployment easier and underline which files in the build directory are important. zstd was picked for compression because of the very good compression ratio.
2 daysMake GOOS and GOARCH part of executable namexengineering
This renames `sia-server` to `sia-server-linux-amd64`. This makes clear for which target environment the executable is built and allows to later place additional executables for other environments too without name collisions.
2 daysDisable log timestampsxengineering
The primary target environment is a systemd-based Linux system. There the logging system of the operating system will timestamp the log messages.
2 daysAdd startup config loggingxengineering
This is useful during early development to make possible misconfiguration visible. Later it might be dropped especially if the config gets larger.
2 daysImplement passing user configurationxengineering
This allows overwriting values of the default configuration with custom ones.
2 daysAdd StartupConfiguration.Validate()xengineering
This method makes it easy to validate a configuration. A call of it is now embedded into the StartupConfiguration.FromJSON() method which should always be the lowest level function to parse configurations. Thus configurations can usually be trusted.
2 daysUse default configxengineering
The default config JSON is embedded as bytes into the executable. Instead of constants the default values are now parsed from these embedded bytes.
2 daysAdd default config parsingxengineering
This is a first step towards configurability.
2 daysAdd Meson target `test` for unit testingxengineering
2 daysImplement <prefix>/server/healthxengineering
This indicates if the Sia server is available and connected to the MQTT broker. Using the MQTT Will messages these will also be sent if the Sia server unexpectedly crashes. Using the retained flag it is ensured that freshly connected MQTT clients will receive these messages even when they missed the initial one from the Sia server.
2 daysImplement Homematic reconnectsxengineering
This is as simple as do not handling errors on state polling. It ensures the server does not panic when the connection to the OpenCCU is temporarily not alive.
2 daysSeparate Homematic codexengineering
Similar to a previous refactoring of the MQTT-related code this removes all Homematic logic to a dedicated file. The only connection to the outside is the `tx chan MQTTMessage` channel and the `HomematicRun()` function. This makes the code more modular.
2 daysAdd MQTT keepalivesxengineering
This issues ping request / response messages between the Sia server and the MQTT broker making sure an interrupted connection is noticed.
2 daysImplement MQTT reconnectsxengineering
This is a central requirement to ensure a restart of the MQTT broker does not harm the Sia server operation.
2 daysLog MQTT disconnectxengineering
This makes connection loss visible during debugging.
2 daysSeparate MQTT logicxengineering
This reduces the coupling between the MQTT-related code and everything else to a single `tx` channel of type `MQTTMessage`. This improves the code quality significantly.
2 daysRaise to QoS 1xengineering
This ensures the state updates reach the broker. QoS 2 is not required since multiple reception of the same state will not make a difference.
2 daysSwitch ClientId to `siaserver`xengineering
The old version `sia-server` was problematic since the MQTT specification [1] ensures only this list of valid characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ For every other character the broker might support this or not. [1]: https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718031
2 daysUpdate payload for contact statesxengineering
`true` and `false` are bad values to describe a contact state. `open` and `closed` make much more sense.
2 daysPublish state in retained modexengineering
This ensures the MQTT broker caches the state when it is sent by Sia and sends it via MQTT to new MQTT clients. Thus no state polling is required by the MQTT client.
2 daysReduce polling period to 50 msxengineering
The human reaction time is roughly 100 ms. The Nyquist-Shannon sampling theorem [1] is used for an approximation how often it is required to sample without humans noticing any delays. [1]: https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem
2 daysAdd cache implementationxengineering
This avoids frequent MQTT messages containing the same state.
2 daysAdd continuous polling executionxengineering
This state polls the device states with 500 milliseconds period and publishes the state on every poll.
2 daysRefactor with Poll() functionxengineering
This function allows to reduce the lines of code in main() further.
2 daysRefactor with Start() and Stop()xengineering
This reduces the lines of code of the main() function significantly and groups all start and stop actions.
2 daysAdd logging for init and de-init stepsxengineering
This helps to debug potential issues.
2 daysRun go fmtxengineering
2 daysRefactor MQTT connect / disconnectxengineering
2 daysChange topic structurexengineering
The new structure for the contact states is the following. <prefix>/contact/<id>/state The reasoning is: - `<prefix>` allows using multiple (Sia) services on the same broker - `contact` as device type indicates contact-specific semantics - `<id>` makes different contacts distinguishable - `state` is the actual payload
2 daysChange topic prefix to `sia`xengineering
The old prefix `sia-server` was longer and not completely correct. The topics under this prefix never belong more to the server or the clients. Thus only `sia` seams to be a good solution.
2 daysRefactor with OPENCCU constantxengineering
This unifies the HOST and PORT constants used so far and removes the need for a fmt.Sprintf() call.
2 daysPublish contact state with MQTTxengineering
This demonstrates the ability to take information from the Homematic system to MQTT. It is a major proof of concept step towards a minimal viable product (MVP) Sia server.
2 daysAdd github.com/eclipse/paho.mqtt.golangxengineering
This dependency is required to use MQTT with Go.
12 daysAdopt homematic-go examplexengineering
This requests a list of devices from the Homematic central device and then queries the state of every `SHUTTER_CONTACT`. This is a good starting point for the server logic.
12 daysAdd homematic-go v0.1.0xengineering
This is the minimal viable product (MVP) of this library suitable to build the MVP of the sia-server.
12 daysAdd Go module xengineering.eu/sia-serverxengineering
This allows to add dependencies to this Go project.
2025-12-08Add Meson build systemxengineering
Meson as a general purpose build system is mightier than what the Go tool can provide. Furthermore it makes it possible to unify build, run and other workflows across projects with different languages.
2025-12-08Add hello world as main.goxengineering
This is just a minimal starting point for the repository.
2025-12-08Add AGPL as LICENSE.txtxengineering