Status Information of Power Device?

Basic Information:

Printer Model:Sovol SV08
MCU / Printerboard:
Host / SBC
klippy.log

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

Hello everyone,
my name is Frank and I am new in your Forum.
I use two printer with Mainline Klipper (Sidewinder X2 and Sovol SV08) and I do have one question concerning writing a macro.

I upgraded my SV08 with an Enclosure Heating and Temperature Sensor. The Heating (220V) is controlled by a Shelly Relay switching on and off. This Relay is inserted in the “moonraker.conf” as a power device (see):

[power Enclosure_Heating]
type: shelly
address: 192.168.XXX.XXX
output_id: 1
initial_state: off
off_when_shutdown: True
off_when_shutdown_delay: 0
#on_when_job_queued: true
locked_while_printing: False
restart_klipper_when_powered: False

Now I want to use the “Status Information” of this Relay (if it is On or Off) in another macro; something like this:

[gcode_macro TEST]
gcode:
{% if device_power device=“Enclosure_Heating” state=on %}
{action_respond_info(“Test On!”)}

{% else %}
{action_respond_info(“Test Off!”)}

{% endif %}

BUT this is not working (would have been to easy)!

So how can I get the Status Information of this Relay (because moonraker knows if it is On or Off) to write a macro?

Thanks a lot in advance.

Hi @honk013 ,

Which heater and thermistor are you using? A link would be helpful here.
Does heater have its own internal temperature PID control, or does it rely on external control? If it relies on external control, you can configure it as a heater_generic with a heater and thermistor pin and let Klipper control it.

Check if the following answers your question: Configuration - Moonraker

Hello,

it is a small 60 x 60 mm PTC Heater. BUT it is not about the Heater or the Sensor!! They are working fine, in my configuration.

It is about the Shelly Relay controlling this Heater (On / Off). I want to know if it is possible to receive the information about the Status of this Relay from Klipper/Moonraker?

In the list of the Power Button I see the Status of this Relay.

I can turn it on and off and the the Icon is changing. So I assume, that Klipper knows about the Status of this Power Device. But how can I call up this information?

I just supplemented the power entry in the moonraker.conf by the “poll_interval” point.

[power Enclosure_Heating]
type: shelly
address: 192.168.XXX.XXX

poll_interval: 5

Now Klipper is also noticing the power change of the Relay when I do it via the Shelly WebUI i.e.

1 Like

Kind request: Please use the Preformatted Text feature of the forum editor when posting code. It’s way better readable then and leading spaces are not omitted.
Format

It may be possible to “Get” the status from a macro if you don’t want to “poll” continuously.