You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey y'all, I'm trying to make a little gcode macro that'll set up Home Assistant auto mqtt discovery for me, and had a quick question. From the docs, I found this example:
[gcode_macro PUBLISH_ALERT]
gcode:
{% set data = params.PAYLOAD|default(None) %}
{action_call_remote_method("publish_mqtt_topic",
topic="klipper/alert",
payload=data,
qos=0,
retain=False,
use_prefix=True)}
where the use_prefix command is defined as:
use_prefix: When set to True the configured instance_name will be prefixed to the topic. For example, if the instance_name is my_printer and the topic is klipper/alert the published topic will be my_printer/klipper/alert. The default is False.
Does anyone know if there's a way to manually access the instance_name parameter? I'd like to be able to send to a topic along the lines of homeassistant/{instance_name}/klipper. Thanks for any help!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey y'all, I'm trying to make a little gcode macro that'll set up Home Assistant auto mqtt discovery for me, and had a quick question. From the docs, I found this example:
where the
use_prefix
command is defined as:Does anyone know if there's a way to manually access the
instance_name
parameter? I'd like to be able to send to a topic along the lines ofhomeassistant/{instance_name}/klipper
. Thanks for any help!Beta Was this translation helpful? Give feedback.
All reactions