dbus2mqtt 0.4.4__tar.gz → 0.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of dbus2mqtt might be problematic. Click here for more details.

Files changed (104) hide show
  1. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/release-drafter.yml +2 -2
  2. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/workflows/ci.yml +2 -1
  3. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/workflows/deploy-docs.yml +1 -1
  4. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/workflows/docker-dev.yml +2 -1
  5. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/workflows/docker-stable.yml +2 -2
  6. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/workflows/pre-commit.yml +1 -1
  7. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/workflows/publish.yml +1 -1
  8. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/workflows/trivy.yml +2 -2
  9. dbus2mqtt-0.5.1/.markdownlint.json +4 -0
  10. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.pre-commit-config.yaml +11 -5
  11. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/PKG-INFO +12 -124
  12. dbus2mqtt-0.5.1/README.md +91 -0
  13. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docker/Dockerfile.dev +1 -1
  14. dbus2mqtt-0.5.1/docs/assets/favicon.svg +22 -0
  15. dbus2mqtt-0.5.1/docs/assets/logo-dark-img.svg +11 -0
  16. dbus2mqtt-0.5.1/docs/assets/logo-dark-text.png +0 -0
  17. dbus2mqtt-0.5.1/docs/assets/logo-dark-text.svg +22 -0
  18. dbus2mqtt-0.5.1/docs/assets/logo-light-img.svg +11 -0
  19. dbus2mqtt-0.5.1/docs/assets/logo-light-text.svg +22 -0
  20. dbus2mqtt-0.5.1/docs/developer/index.md +56 -0
  21. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/examples/bluez.md +0 -2
  22. dbus2mqtt-0.5.1/docs/examples/connman-config.md +20 -0
  23. dbus2mqtt-0.5.1/docs/examples/connman-config.yaml +186 -0
  24. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/examples/dbus2mqtt_internal_state.md +3 -2
  25. dbus2mqtt-0.4.4/docs/examples/home_assistant_media_player.md → dbus2mqtt-0.5.1/docs/examples/home_assistant_media_player/mqtt_mediaplayer.yaml +0 -81
  26. dbus2mqtt-0.5.1/docs/examples/home_assistant_media_player.md +82 -0
  27. dbus2mqtt-0.5.1/docs/examples/linux_desktop/notify.json +13 -0
  28. dbus2mqtt-0.5.1/docs/examples/linux_desktop/notify_with_actions_and_hints.json +13 -0
  29. dbus2mqtt-0.5.1/docs/examples/linux_desktop.md +56 -0
  30. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/examples/linux_desktop.yaml +30 -0
  31. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/flows/flow_actions.md +4 -6
  32. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/flows/flow_triggers.md +42 -0
  33. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/flows/index.md +21 -4
  34. dbus2mqtt-0.5.1/docs/overrides/main.html +8 -0
  35. dbus2mqtt-0.5.1/docs/setup.md +80 -0
  36. dbus2mqtt-0.5.1/docs/stylesheets/extra.css +4 -0
  37. dbus2mqtt-0.5.1/docs/subscriptions.md +199 -0
  38. dbus2mqtt-0.5.1/docs/templating/index.md +14 -0
  39. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/mkdocs.yml +22 -21
  40. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/pyproject.toml +1 -1
  41. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/config/__init__.py +32 -15
  42. dbus2mqtt-0.5.1/src/dbus2mqtt/config/jsonarparse.py +38 -0
  43. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/dbus/dbus_client.py +126 -16
  44. dbus2mqtt-0.5.1/src/dbus2mqtt/dbus/dbus_util.py +182 -0
  45. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/event_broker.py +7 -3
  46. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/flow/flow_processor.py +6 -3
  47. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/mqtt/mqtt_client.py +50 -2
  48. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/template/dbus_template_functions.py +1 -1
  49. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/__init__.py +28 -22
  50. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/dbus/test_dbus_client_mqtt_command.py +3 -2
  51. dbus2mqtt-0.5.1/tests/dbus/test_dbus_utils.py +407 -0
  52. dbus2mqtt-0.5.1/tests/flow/triggers/test_mqtt_client_triggers.py +101 -0
  53. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/uv.lock +161 -280
  54. dbus2mqtt-0.4.4/README.md +0 -203
  55. dbus2mqtt-0.4.4/docs/developer/index.md +0 -15
  56. dbus2mqtt-0.4.4/docs/examples/linux_desktop.md +0 -30
  57. dbus2mqtt-0.4.4/src/dbus2mqtt/config/jsonarparse.py +0 -32
  58. dbus2mqtt-0.4.4/src/dbus2mqtt/dbus/dbus_util.py +0 -24
  59. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.dockerignore +0 -0
  60. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.env.example +0 -0
  61. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  62. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  63. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/scripts/release-versions.py +0 -0
  64. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.github/workflows/release-drafter.yml +0 -0
  65. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.gitignore +0 -0
  66. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.python-version +0 -0
  67. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.vscode/launch.json +0 -0
  68. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.vscode/settings.json +0 -0
  69. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/.yamllint.yml +0 -0
  70. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/LICENSE +0 -0
  71. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docker/Dockerfile.pypi +0 -0
  72. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/developer/debugging_dbus.md +0 -0
  73. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/examples/bluez.yaml +0 -0
  74. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/examples/dbus2mqtt_internal_state.yaml +0 -0
  75. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/examples/home_assistant_media_player.yaml +0 -0
  76. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/examples/index.md +0 -0
  77. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/hooks.py +0 -0
  78. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/docs/index.md +0 -0
  79. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/renovate.json +0 -0
  80. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/__init__.py +0 -0
  81. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/__main__.py +0 -0
  82. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/dbus/dbus_types.py +0 -0
  83. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/dbus/introspection_patches/mpris_playerctl.py +0 -0
  84. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/dbus/introspection_patches/mpris_vlc.py +0 -0
  85. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/flow/__init__.py +0 -0
  86. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/flow/actions/context_set.py +0 -0
  87. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/flow/actions/log_action.py +0 -0
  88. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/flow/actions/mqtt_publish.py +0 -0
  89. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/main.py +0 -0
  90. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/src/dbus2mqtt/template/templating.py +0 -0
  91. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/config/fixtures/payload_template_jinja_expressions.yaml +0 -0
  92. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/config/fixtures/payload_template_off.yaml +0 -0
  93. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/config/fixtures/schedule_cron_trigger.yaml +0 -0
  94. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/config/test_config.py +0 -0
  95. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/config/test_examples.py +0 -0
  96. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/conftest.py +0 -0
  97. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/dbus/test_dbus_client.py +0 -0
  98. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/flow/actions/test_context_set.py +0 -0
  99. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/flow/actions/test_log.py +0 -0
  100. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/flow/actions/test_mqtt_publish.py +0 -0
  101. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/flow/test_flow_processor.py +0 -0
  102. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/flow/triggers/test_dbus_client_triggers.py +0 -0
  103. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/template/test_templating.py +0 -0
  104. {dbus2mqtt-0.4.4 → dbus2mqtt-0.5.1}/tests/template/test_templating_config.py +0 -0
@@ -27,7 +27,7 @@ autolabeler:
27
27
  - label: enhancement
28
28
  branch:
29
29
  - '/feature\/.+/'
30
- - label: fix
30
+ - label: bugfix
31
31
  branch:
32
32
  - '/fix\/.+/'
33
33
  title:
@@ -46,6 +46,6 @@ version-resolver:
46
46
  - feature # patch until we are on 1.x
47
47
  - enhancement # patch until we are on 1.x
48
48
  default: patch
49
- change-template: '* $TITLE (#$NUMBER)'
49
+ change-template: '* $TITLE (#$NUMBER) by @$AUTHOR'
50
50
  template: |
51
51
  $CHANGES
@@ -19,9 +19,10 @@ jobs:
19
19
  - "3.11"
20
20
  - "3.12"
21
21
  - "3.13"
22
+ - "3.14"
22
23
 
23
24
  steps:
24
- - uses: actions/checkout@v4
25
+ - uses: actions/checkout@v5
25
26
 
26
27
  - name: Install uv
27
28
  uses: astral-sh/setup-uv@v6
@@ -12,7 +12,7 @@ jobs:
12
12
  contents: write
13
13
  steps:
14
14
  - name: Checkout
15
- uses: actions/checkout@v4
15
+ uses: actions/checkout@v5
16
16
  with:
17
17
  fetch-depth: 0
18
18
  - name: Configure Git Credentials
@@ -10,6 +10,7 @@ name: docker-dev
10
10
  - '.pre-commit-config.yaml'
11
11
  - 'README.md'
12
12
  - 'renovate.json'
13
+ - 'mkdocs.yaml'
13
14
  workflow_dispatch:
14
15
 
15
16
  jobs:
@@ -19,7 +20,7 @@ jobs:
19
20
  packages: write
20
21
  steps:
21
22
  - name: Checkout
22
- uses: actions/checkout@v4
23
+ uses: actions/checkout@v5
23
24
 
24
25
  - name: Install uv
25
26
  uses: astral-sh/setup-uv@v6
@@ -19,7 +19,7 @@ jobs:
19
19
  versions_matrix: ${{ steps.supported_release_versions.outputs.versions_matrix }}
20
20
  steps:
21
21
  - name: Checkout
22
- uses: actions/checkout@v4
22
+ uses: actions/checkout@v5
23
23
  with:
24
24
  fetch-depth: 0
25
25
 
@@ -46,7 +46,7 @@ jobs:
46
46
 
47
47
  steps:
48
48
  - name: Checkout
49
- uses: actions/checkout@v4
49
+ uses: actions/checkout@v5
50
50
 
51
51
  - name: Docker meta
52
52
  id: meta
@@ -13,7 +13,7 @@ jobs:
13
13
  pre-commit:
14
14
  runs-on: ubuntu-latest
15
15
  steps:
16
- - uses: actions/checkout@v4
16
+ - uses: actions/checkout@v5
17
17
 
18
18
  - name: Install uv
19
19
  uses: astral-sh/setup-uv@v6
@@ -12,7 +12,7 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
 
14
14
  steps:
15
- - uses: actions/checkout@v4
15
+ - uses: actions/checkout@v5
16
16
  with:
17
17
  persist-credentials: false
18
18
 
@@ -18,10 +18,10 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
20
  - name: Checkout code
21
- uses: actions/checkout@v4
21
+ uses: actions/checkout@v5
22
22
 
23
23
  - name: Run Trivy vulnerability scanner
24
- uses: aquasecurity/trivy-action@0.32.0
24
+ uses: aquasecurity/trivy-action@0.33.1
25
25
  with:
26
26
  image-ref: ghcr.io/jwnmulder/dbus2mqtt:latest
27
27
  format: 'sarif'
@@ -0,0 +1,4 @@
1
+ {
2
+ "MD013": false,
3
+ "MD033": false
4
+ }
@@ -33,7 +33,7 @@ repos:
33
33
  - --strict
34
34
 
35
35
  - repo: https://github.com/astral-sh/ruff-pre-commit
36
- rev: v0.12.10
36
+ rev: v0.12.12
37
37
  hooks:
38
38
  - id: ruff
39
39
  args:
@@ -42,16 +42,22 @@ repos:
42
42
  - I
43
43
 
44
44
  - repo: https://github.com/astral-sh/uv-pre-commit
45
- rev: 0.8.13
45
+ rev: 0.8.15
46
46
  hooks:
47
47
  - id: uv-lock
48
48
 
49
49
  - repo: https://github.com/RobertCraigie/pyright-python
50
- rev: v1.1.404
50
+ rev: v1.1.405
51
51
  hooks:
52
52
  - id: pyright
53
53
 
54
- - repo: https://github.com/fpgmaas/deptry
55
- rev: "0.23.1"
54
+ - repo: local
56
55
  hooks:
57
56
  - id: deptry
57
+ name: deptry
58
+ entry: uv run deptry .
59
+ language: python
60
+ additional_dependencies:
61
+ - uv
62
+ always_run: true
63
+ pass_filenames: false
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dbus2mqtt
3
- Version: 0.4.4
3
+ Version: 0.5.1
4
4
  Summary: General purpose DBus to MQTT bridge - expose signals, methods and properties over MQTT - featuring jinja based templating, payload enrichment and MPRIS / BlueZ / Home Assistant ready examples
5
5
  Project-URL: Documentation, https://jwnmulder.github.io/dbus2mqtt
6
6
  Project-URL: Source, https://github.com/jwnmulder/dbus2mqtt
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Programming Language :: Python :: 3.11
18
18
  Classifier: Programming Language :: Python :: 3.12
19
19
  Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
20
21
  Classifier: Topic :: Home Automation
21
22
  Requires-Python: >=3.10
22
23
  Requires-Dist: apscheduler>=3.11.0
@@ -27,7 +28,6 @@ Requires-Dist: jinja2-ansible-filters>=1.3.2
27
28
  Requires-Dist: jinja2>=3.1.6
28
29
  Requires-Dist: jsonargparse>=4.38.0
29
30
  Requires-Dist: paho-mqtt>=2.1.0
30
- Requires-Dist: pydantic>=2.11.3
31
31
  Requires-Dist: python-dotenv>=1.1.0
32
32
  Requires-Dist: pyyaml>=6.0.2
33
33
  Description-Content-Type: text/markdown
@@ -51,7 +51,7 @@ This makes it easy to integrate Linux desktop services or system signals into MQ
51
51
 
52
52
  **dbus2mqtt** is considered stable for the use-cases it has been tested against, and is actively being developed. Documentation is continuously being improved.
53
53
 
54
- Initial testing has focused on MPRIS integration. A table of tested MPRIS players and their supported methods can be found here: [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player/)
54
+ Initial testing has focused on MPRIS integration. A table of tested MPRIS players and their supported methods can be found on [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player.html)
55
55
 
56
56
  ## Getting started with dbus2mqtt
57
57
 
@@ -94,7 +94,6 @@ MQTT__USERNAME=
94
94
  MQTT__PASSWORD=
95
95
  ```
96
96
 
97
-
98
97
  ### Install and run dbus2mqtt
99
98
 
100
99
  ```bash
@@ -102,136 +101,25 @@ python -m pip install dbus2mqtt
102
101
  dbus2mqtt --config config.yaml
103
102
  ```
104
103
 
105
-
106
- ### Run using docker with auto start behavior
107
-
108
- To build and run dbus2mqtt using Docker with the [home_assistant_media_player.yaml](https://github.com/jwnmulder/dbus2mqtt/blob/main/docs/examples/home_assistant_media_player.yaml) example from this repository.
109
-
110
- ```bash
111
- # setup configuration
112
- mkdir -p $HOME/.config/dbus2mqtt
113
- cp docs/examples/home_assistant_media_player.yaml $HOME/.config/dbus2mqtt/config.yaml
114
- cp .env.example $HOME/.config/dbus2mqtt/.env
115
-
116
- # run image and automatically start on reboot
117
- sudo docker pull jwnmulder/dbus2mqtt
118
- sudo docker run --detach --name dbus2mqtt \
119
- --volume "$HOME"/.config/dbus2mqtt:"$HOME"/.config/dbus2mqtt \
120
- --volume /run/user:/run/user \
121
- --env DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" \
122
- --env-file "$HOME"/.config/dbus2mqtt/.env \
123
- --user $(id -u):$(id -g) \
124
- --privileged \
125
- --restart unless-stopped \
126
- jwnmulder/dbus2mqtt \
127
- --config "$HOME"/.config/dbus2mqtt/config.yaml
128
-
129
- # view logs
130
- sudo docker logs dbus2mqtt -f
131
- ```
104
+ See [setup](https://jwnmulder.github.io/dbus2mqtt/setup.html) for more installation options and configuration details.
132
105
 
133
106
  ## Examples
134
107
 
135
- More dbus2mqtt examples can be found here: [examples](https://jwnmulder.github.io/dbus2mqtt/examples/).
136
- The most complete one being [MPRIS to Home Assistant Media Player integration](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player/)
137
-
138
- ## Configuration reference
139
-
140
- dbus2mqtt leverages [jsonargparse](https://jsonargparse.readthedocs.io/en/stable/) which allows configuration via either yaml configuration, CLI or environment variables. Until this is fully documented have a look at the examples in this repository.
141
-
142
- ### MQTT and D-Bus connection details
143
-
144
- ```bash
145
- # dbus_fast configuration
146
- export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
147
-
148
- # dbus2mqtt configuration
149
- MQTT__HOST=localhost
150
- MQTT__PORT=1883
151
- MQTT__USERNAME=
152
- MQTT__PASSWORD=
153
- ```
154
-
155
- or
156
-
157
- ```yaml
158
- mqtt:
159
- host: localhost
160
- port: 1883
161
- subscription_topics:
162
- - dbus2mqtt/#
163
- ```
164
-
165
- ### Exposing dbus methods
166
-
167
- ```yaml
168
- dbus:
169
- subscriptions:
170
- - bus_name: org.mpris.MediaPlayer2.*
171
- path: /org/mpris/MediaPlayer2
172
- interfaces:
173
- - interface: org.mpris.MediaPlayer2.Player
174
- mqtt_command_topic: dbus2mqtt/org.mpris.MediaPlayer2/command
175
- methods:
176
- - method: Pause
177
- - method: Play
178
- ```
179
-
180
- This configuration will expose 2 methods. Triggering methods can be done by publishing json messages to the `dbus2mqtt/org.mpris.MediaPlayer2/command` MQTT topic. Arguments can be passed along in `args`.
108
+ More dbus2mqtt examples can be found in the [examples](https://jwnmulder.github.io/dbus2mqtt/examples/index.html) section.
109
+ The most complete one being [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player.html)
181
110
 
182
- Some examples that call methods on **all** bus_names matching the configured pattern
111
+ ## Exposing dbus methods, properties and signals
183
112
 
184
- ```json
185
- {
186
- "method": "Play",
187
- }
188
- ```
113
+ See [subscriptions](https://jwnmulder.github.io/dbus2mqtt/subscriptions.html) for documentation on calling methods, setting properties and exposing D-Bus signals to MQTT. When configured, D-Bus methods can be invoked by publishing a message like
189
114
 
190
115
  ```json
191
116
  {
192
- "method": "OpenUri",
193
- "args": []
117
+ "method": "Play"
194
118
  }
195
119
  ```
196
120
 
197
- To specifically target objects the properties `bus_name` and/or `path` can be used. Both properties support wildcards
198
-
199
- ```json
200
- {
201
- "method": "Play",
202
- "bus_name": "*.firefox",
203
- "path": "/org/mpris/MediaPlayer2"
204
- }
205
- ```
206
-
207
- ### Exposing dbus signals
208
-
209
- Publishing signals to MQTT topics works by subscribing to the relevant signal and using flows for publishing
210
-
211
- ```yaml
212
- dbus:
213
- subscriptions:
214
- - bus_name: org.mpris.MediaPlayer2.*
215
- path: /org/mpris/MediaPlayer2
216
- interfaces:
217
- - interface: org.freedesktop.DBus.Properties
218
- signals:
219
- - signal: PropertiesChanged
220
-
221
- flows:
222
- - name: "Property Changed flow"
223
- triggers:
224
- - type: on_signal
225
- actions:
226
- - type: mqtt_publish
227
- topic: dbus2mqtt/org.mpris.MediaPlayer2/signals/PropertiesChanged
228
- payload_type: json
229
- ```
230
-
231
- ## Flows
232
-
233
- A reference of all supported flow triggers and actions can be found on [Flows](https://jwnmulder.github.io/dbus2mqtt/flows/)
121
+ ## Flows and Jinja based templating
234
122
 
235
- ## Jinja templating
123
+ For more advanced use-cases, dbus2mqtt has support for flows and Jinja2 based templates. A reference of all supported flow triggers and actions can be found on [flows](https://jwnmulder.github.io/dbus2mqtt/flows/index.html)
236
124
 
237
- TODO: Document Jinja templating, for now see the [MPRIS to Home Assistant Media Player integration](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player/) example
125
+ Jinja templating documentation can be found here: [templating](https://jwnmulder.github.io/dbus2mqtt/templating/index.html)
@@ -0,0 +1,91 @@
1
+ # dbus2mqtt
2
+
3
+ **dbus2mqtt** is a Python application that bridges **DBus** with **MQTT**.
4
+ It lets you forward Linux D-Bus signals and properties to MQTT topics, call D-Bus methods via MQTT messages, and shape payloads using flexible **Jinja2 templating**.
5
+
6
+ This makes it easy to integrate Linux desktop services or system signals into MQTT-based workflows - including **Home Assistant**.
7
+
8
+ ## Features
9
+
10
+ * 🔗 Forward **D-Bus signals** to MQTT topics.
11
+ * 🧠 Enrich or transform **MQTT payloads** using Jinja2 templates and additional D-Bus calls.
12
+ * ⚡ Trigger message publishing via **signals, timers, property changes, or startup events**.
13
+ * 📡 Expose **D-Bus methods** for remote control via MQTT messages.
14
+ * 🏠 Includes example configurations for **MPRIS** and **Home Assistant Media Player** integration.
15
+
16
+ ## Project status
17
+
18
+ **dbus2mqtt** is considered stable for the use-cases it has been tested against, and is actively being developed. Documentation is continuously being improved.
19
+
20
+ Initial testing has focused on MPRIS integration. A table of tested MPRIS players and their supported methods can be found on [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player.html)
21
+
22
+ ## Getting started with dbus2mqtt
23
+
24
+ Create a `config.yaml` file with the contents shown below. This configuration will expose all bus properties from the `org.mpris.MediaPlayer2.Player` interface to MQTT on the `dbus2mqtt/org.mpris.MediaPlayer2/state` topic.
25
+
26
+ ```yaml
27
+ dbus:
28
+ subscriptions:
29
+ - bus_name: org.mpris.MediaPlayer2.*
30
+ path: /org/mpris/MediaPlayer2
31
+ interfaces:
32
+ - interface: org.freedesktop.DBus.Properties
33
+ methods:
34
+ - method: GetAll
35
+
36
+ flows:
37
+ - name: "Publish MPRIS state"
38
+ triggers:
39
+ - type: object_added
40
+ - type: schedule
41
+ interval: {seconds: 5}
42
+ actions:
43
+ - type: context_set
44
+ context:
45
+ mpris_bus_name: '{{ dbus_list("org.mpris.MediaPlayer2.*") | first }}'
46
+ path: /org/mpris/MediaPlayer2
47
+ - type: mqtt_publish
48
+ topic: dbus2mqtt/org.mpris.MediaPlayer2/state
49
+ payload_type: json
50
+ payload_template: |
51
+ {{ dbus_call(mpris_bus_name, path, 'org.freedesktop.DBus.Properties', 'GetAll', ['org.mpris.MediaPlayer2.Player']) }}
52
+ ```
53
+
54
+ MQTT connection details can be configured in that same `config.yaml` file or via environment variables. For now create a `.env` file with the following contents.
55
+
56
+ ```bash
57
+ MQTT__HOST=localhost
58
+ MQTT__PORT=1883
59
+ MQTT__USERNAME=
60
+ MQTT__PASSWORD=
61
+ ```
62
+
63
+ ### Install and run dbus2mqtt
64
+
65
+ ```bash
66
+ python -m pip install dbus2mqtt
67
+ dbus2mqtt --config config.yaml
68
+ ```
69
+
70
+ See [setup](https://jwnmulder.github.io/dbus2mqtt/setup.html) for more installation options and configuration details.
71
+
72
+ ## Examples
73
+
74
+ More dbus2mqtt examples can be found in the [examples](https://jwnmulder.github.io/dbus2mqtt/examples/index.html) section.
75
+ The most complete one being [Mediaplayer integration with Home Assistant](https://jwnmulder.github.io/dbus2mqtt/examples/home_assistant_media_player.html)
76
+
77
+ ## Exposing dbus methods, properties and signals
78
+
79
+ See [subscriptions](https://jwnmulder.github.io/dbus2mqtt/subscriptions.html) for documentation on calling methods, setting properties and exposing D-Bus signals to MQTT. When configured, D-Bus methods can be invoked by publishing a message like
80
+
81
+ ```json
82
+ {
83
+ "method": "Play"
84
+ }
85
+ ```
86
+
87
+ ## Flows and Jinja based templating
88
+
89
+ For more advanced use-cases, dbus2mqtt has support for flows and Jinja2 based templates. A reference of all supported flow triggers and actions can be found on [flows](https://jwnmulder.github.io/dbus2mqtt/flows/index.html)
90
+
91
+ Jinja templating documentation can be found here: [templating](https://jwnmulder.github.io/dbus2mqtt/templating/index.html)
@@ -20,7 +20,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
20
20
  --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
21
21
  uv sync --frozen --no-install-project --no-dev
22
22
 
23
- ADD src/ pyproject.toml uv.lock README.md /app
23
+ ADD src/ pyproject.toml uv.lock README.md /app/
24
24
  RUN --mount=type=cache,target=/root/.cache/uv \
25
25
  uv sync --frozen --no-dev
26
26
 
@@ -0,0 +1,22 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 35 47" role="img" aria-label="dbus2 MQTT logo">
2
+ <defs>
3
+ <style>
4
+ .word {
5
+ font-family: Inter, Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
6
+ font-size: 64px;
7
+ font-weight: 600;
8
+ fill: #1F2937;
9
+ }
10
+ .num {
11
+ font-family: Inter, Roboto, system-ui, sans-serif;
12
+ font-size: 64px;
13
+ font-weight: 700;
14
+ fill: #7B1FA2;
15
+ }
16
+ </style>
17
+ </defs>
18
+
19
+ <!-- <text x="0" y="50" class="word">dbus</text> -->
20
+ <text x="0" y="46" class="num">2</text>
21
+ <!-- <text x="0" y="105" class="word">MQTT</text> -->
22
+ </svg>
@@ -0,0 +1,11 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 80">
2
+
3
+ <!-- Connection (angular polyline) behind, vertical in the middle of the dots -->
4
+ <polyline points="20,40 50,10 50,70 80,40" stroke="#1F2937" stroke-width="10" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
5
+
6
+ <!-- DBus node in purple -->
7
+ <circle cx="20" cy="40" r="14" fill="#7B1FA2"/>
8
+
9
+ <!-- MQTT node in purple -->
10
+ <circle cx="80" cy="40" r="14" fill="#7B1FA2"/>
11
+ </svg>
@@ -0,0 +1,22 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 110" role="img" aria-label="dbus2 MQTT logo">
2
+ <defs>
3
+ <style>
4
+ .word {
5
+ font-family: Inter, Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
6
+ font-size: 64px;
7
+ font-weight: 600;
8
+ fill: #1F2937;
9
+ }
10
+ .num {
11
+ font-family: Inter, Roboto, system-ui, sans-serif;
12
+ font-size: 64px;
13
+ font-weight: 700;
14
+ fill: #7B1FA2;
15
+ }
16
+ </style>
17
+ </defs>
18
+
19
+ <text x="0" y="50" class="word">dbus</text>
20
+ <text x="143" y="50" class="num">2</text>
21
+ <text x="0" y="105" class="word">MQTT</text>
22
+ </svg>
@@ -0,0 +1,11 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 80">
2
+
3
+ <!-- Connection (angular polyline) behind, vertical in the middle of the dots -->
4
+ <polyline points="20,40 50,10 50,70 80,40" stroke="#FFFFFF" stroke-width="10" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
5
+
6
+ <!-- DBus node in purple -->
7
+ <circle cx="20" cy="40" r="14" fill="#BE90FF"/>
8
+
9
+ <!-- MQTT node in purple -->
10
+ <circle cx="80" cy="40" r="14" fill="#BE90FF"/>
11
+ </svg>
@@ -0,0 +1,22 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 180 110" role="img" aria-label="dbus2 MQTT logo">
2
+ <defs>
3
+ <style>
4
+ .word {
5
+ font-family: Inter, Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
6
+ font-size: 64px;
7
+ font-weight: 600;
8
+ fill: #FFFFFF;
9
+ }
10
+ .num {
11
+ font-family: Inter, Roboto, system-ui, sans-serif;
12
+ font-size: 64px;
13
+ font-weight: 700;
14
+ fill: #BE90FF;
15
+ }
16
+ </style>
17
+ </defs>
18
+
19
+ <text x="0" y="50" class="word">dbus</text>
20
+ <text x="143" y="50" class="num">2</text>
21
+ <text x="0" y="105" class="word">MQTT</text>
22
+ </svg>
@@ -0,0 +1,56 @@
1
+ # Developer guide
2
+
3
+ ## Specifications
4
+
5
+ Generic DBus specifications:
6
+
7
+ * [D-Bus Tutorial](https://dbus.freedesktop.org/doc/dbus-tutorial.html)
8
+ * [D-Bus Specification](https://dbus.freedesktop.org/doc/dbus-specification.html)
9
+
10
+ ## Running from source
11
+
12
+ ```bash
13
+ uv run main.py --config config.yaml
14
+ ```
15
+
16
+ ## Activate Python virtual env
17
+
18
+ ```bash
19
+ uv sync
20
+ source .venv/bin/activate
21
+ ```
22
+
23
+ ## Linting
24
+
25
+ ```bash
26
+ # run pre-commit linters
27
+ uv run pre-commit run --all-files
28
+
29
+ # setup pre-commit to automatically run linters via git hooks
30
+ uv run pre-commit install
31
+ ```
32
+
33
+ ## Publishing and subscribing to MQTT messages
34
+
35
+ Multiple MQTT client exist that can be used for testing, e.g.
36
+
37
+ * [MQTT Explorer](https://mqtt-explorer.com/)
38
+ * [github.com/RISE-Maritime/mqtt-cli](https://github.com/RISE-Maritime/mqtt-cli)
39
+
40
+ ### Using mqtt-cli
41
+
42
+ ```bash
43
+ source .env
44
+
45
+ mqtt() {
46
+ uvx --from mqtt-cli mqtt \
47
+ --host "$MQTT__HOST" \
48
+ --user "$MQTT__USERNAME" \
49
+ --password "$MQTT__PASSWORD" \
50
+ "$@"
51
+ }
52
+
53
+ mqtt --help
54
+ mqtt subscribe --topic 'dbus2mqtt/#'
55
+ mqtt publish -t dbus2mqtt/org.mpris.MediaPlayer2/command -m '{ "method": "Play" }'
56
+ ```
@@ -5,8 +5,6 @@ hide:
5
5
 
6
6
  # Bluez
7
7
 
8
- ## Introduction
9
-
10
8
  This configuration file demonstrates how to use dbus2mqtt to bridge D-Bus events from BlueZ (the official Linux Bluetooth protocol stack) to MQTT topics. It subscribes to relevant D-Bus signals and properties for both the Bluetooth adapter (`hci0`) and all Bluetooth devices managed by BlueZ. The configuration defines flows that:
11
9
 
12
10
  * Monitor property changes and object lifecycle events (added/removed) for the Bluetooth adapter and devices.
@@ -0,0 +1,20 @@
1
+ ---
2
+ hide:
3
+ - toc
4
+ ---
5
+
6
+ # Connman (WIP)
7
+
8
+ Using dbus2mqtt, you can control you network configuration using connman through mqtt topics.
9
+
10
+ ## Setup activities
11
+
12
+ Trying out this example
13
+
14
+ ```bash
15
+ uv run dbus2mqtt --config docs/examples/connman-config.yaml
16
+ ```
17
+
18
+ ## Features
19
+
20
+ This configuration is a passthrough of the D-BUS architecture of connman. refer to connman D-BUS API.