| Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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
|
|
This avoids frequent MQTT messages containing the same state.
|
|
This state polls the device states with 500 milliseconds period and
publishes the state on every poll.
|
|
This function allows to reduce the lines of code in main() further.
|
|
This reduces the lines of code of the main() function significantly and
groups all start and stop actions.
|
|
This helps to debug potential issues.
|
|
|
|
|
|
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
|
|
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.
|
|
This unifies the HOST and PORT constants used so far and removes the
need for a fmt.Sprintf() call.
|
|
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.
|
|
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.
|
|
This is just a minimal starting point for the repository.
|