Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT not publishing some webhook status changes #954

Open
eagle1361 opened this issue Feb 6, 2025 · 1 comment
Open

MQTT not publishing some webhook status changes #954

eagle1361 opened this issue Feb 6, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@eagle1361
Copy link

What happened

When webhooks updates the status to "startup" or "ready", as shown by /printer/objects/query?webhooks, the mqtt client does not publish either of those status changes. It does update when the status is "shutdown". Changing enable_moonraker_api or publish_split_status does not change behavior.

Section:
[mqtt]
address: mqttserveraddress
enable_moonraker_api: True
instance_name: klipper
publish_split_status: True
status_objects:
webhooks
print_stats=state,message

Client

Other

Browser

Other or N/A

How to reproduce

Set MQTT to publish status_object: webhooks. Monitor via MQTT server and web browser get query function. startup and ready status are shown in web browser but not on MQTT server. Shutdown klipper and shutdown message is shown on both locations as expected.

Additional information

moonraker.log

@eagle1361 eagle1361 added the bug Something isn't working label Feb 6, 2025
@Arksine
Copy link
Owner

Arksine commented Feb 7, 2025

This is due to the nature of how Moonraker initializes its connection to Klippy. It polls Klipper's info endpoint until Klipper is out of the startup phase before it requests subscriptions. One reason for this is timing, the internal webhooks state may already be beyond the startup phase by the time Moonraker can establish a connection, so using a webhooks subscription isn't a reliable way to detect the the startup or ready state.

That said, I can look into publishing a status update after the initial subscription, so at the very least you would get the ready state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants