Replies: 3 comments 3 replies
-
|
Hey @ElVit, glad you're enjoying drydock with Home Assistant! Great question. Short answerThe MQTT trigger is outbound only — it publishes container state to your broker but doesn't subscribe to any command topics. So you can't trigger an update via MQTT directly. The correct approach is the Webhook API, which was designed exactly for this use case. How to trigger updates via the REST APIdrydock has a webhook endpoint that triggers container updates:
Since you already have the docker-compose trigger configured, calling this endpoint will use that trigger to pull the new image and recreate the container — exactly what you want. 1. Enable webhooks in drydockAdd these environment variables to your drydock container: services:
drydock:
image: codeswhat/drydock
environment:
- DD_SERVER_WEBHOOK_ENABLED=true
- DD_SERVER_WEBHOOK_TOKEN=your-secret-token-here
# ... your existing config2. Create a Home Assistant REST commandInstead of going through MQTT, use Home Assistant's rest_command:
drydock_update_container:
url: "http://drydock:3000/api/webhook/update/{{ container_name }}"
method: POST
headers:
Authorization: "Bearer your-secret-token-here"3. Create the automationautomation:
- alias: "Trigger drydock update from HA update entity"
trigger:
- platform: event
event_type: call_service
event_data:
domain: update
service: install
condition:
- condition: template
value_template: >
{{ trigger.event.data.service_data.entity_id
| select('match', 'update.dd_')
| list | count > 0 }}
action:
- service: rest_command.drydock_update_container
data:
container_name: >-
{{ trigger.event.data.service_data.entity_id
| replace('update.dd_', '')
}}
Webhook rate limitsWebhook endpoints are rate-limited to 30 requests per 15-minute window, which should be plenty for manual update triggers. Full docsSee the Webhook documentation for all configuration options, including per-endpoint tokens and per-container opt-out via the |
Beta Was this translation helpful? Give feedback.
-
|
Quick follow-up to the earlier reply — native command_topic support for the HA MQTT discovery sensor is now scheduled for v1.6.0 (Phase 5.8). That's the zigbee2mqtt-style pattern: discovery payload ships with Design notes that are already locked in:
The REST-command/webhook workaround in my earlier reply will keep working even after v1.6 ships — the native path is purely additive. Leaving this open as the tracking discussion until the v1.6 work lands. |
Beta Was this translation helpful? Give feedback.
-
|
Just a status note: the REST webhook workaround from my March reply is stable and works on all released RCs including v1.5.0-rc.19. The native bidirectional MQTT path ( If the |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi, thanks for this awsome application :)
I found the way to display the docker updates in home assistant as update entities and its working great 😃.
Now the update entities give the possibilty to also trigger an update.
According to AI this is possible with the follwoing home assistant automation:
The question is now, is it possible to trigger an update in drydock via mqtt?
My docker containers are setup with docker compose so therefore I have added the docker compose trigger in drydock.
What shall the mqtt publish topic look like to trigger an update?
Or is there maybe a better way? Via REST API?
Beta Was this translation helpful? Give feedback.
All reactions