<p>Besides using a different macro, it is also possible to use <a href="https://www.klipper3d.org/Config_Reference.html#homing_override" rel="nofollow noreferrer">[homing_override]</a> which allows you to redefine the homing sequence.</p>
<p>You can write a simple homing_override like (untested!)</p>
<pre><code>[homing_override]
axes: xyz
gcode:
  M80
  G28
</code></pre>
<p>and you are done.</p>
<p>Be aware that this very simple override will home all axes every time homing is called: &quot;G28 X0&quot; will home also Y and Z. You can put checks to home only what is requested, see <a href="https://github.com/zellneralex/klipper_config/blob/master/homing.cfg" rel="nofollow noreferrer">here</a> but it become more involved.</p>

CC BY-SA 4.0
2022-03-15T12:09:19.447Z
Thanks, I saw this. But I decided not to use this exactly because of the reason you mentioned: I'd like to be able to pass arguments as is to the default G28 implementation
Denis Itskovich
CC BY-SA 4.0
2022-03-15T12:59:03.167Z
If you check the link I provided, he homes only what's being requested by checking "{% if params.X is defined %}{% set home_x = True %}{% endif %}" and so on
FarO
CC BY-SA 4.0
2022-03-15T11:09:53.967Z
2022-03-15T11:09:53.967Z
FarO
<p>Because of the way parameters work differently (<code>Sx</code> vs <code>NAME=x</code>) for gcode style commands vs Klipper extended ones, the rename has to be to the &quot;same type&quot; of command. <code>G28_BASE</code> does not fit the pattern to be considered a &quot;gcode style&quot; one. Use <code>G9028</code> or <code>G28.1</code> or something instead and it should work.</p>

CC BY-SA 4.0
2022-02-27T16:04:21.240Z
2022-02-27T16:04:21.240Z
R.. GitHub STOP HELPING ICE
<p>I'd like to force Klipper to perform power on (using <code>M80</code>) before homing. For this purpose I'm trying to override <code>G28</code>:</p>
<pre><code>[gcode_macro G28]
rename_existing: G28_BASE
gcode:
  M80
  G28_BASE { rawparams }
</code></pre>
<p>But for some reason this does not work, I'm getting the following error:</p>
<pre><code>G-Code macro rename of different types ('G28' vs 'G28_BASE')
</code></pre>
<p>Isn't <code>G28</code> overridable? Is there any other way to achieve the desired behavior?</p>

<g-code><homing><power-supply><klipper>
Klipper: power on before homing
Denis Itskovich
# Klipper: power on before homing

(Asked by: username_0 on 2022-02-27)

I'd like to force Klipper to perform power on (using `M80`) before homing. For this purpose I'm trying to override `G28`:

```
[gcode_macro G28]
rename_existing: G28_BASE
gcode:
  M80
  G28_BASE { rawparams }

```

But for some reason this does not work, I'm getting the following error:

```
G-Code macro rename of different types ('G28' vs 'G28_BASE')

```

Isn't `G28` overridable? Is there any other way to achieve the desired behavior?

**Tags:** g-code, homing, power-supply, klipper


---

## 2 answers

### Answer by username_2 on 2022-02-27. Score: 3 | Accepted answer

Because of the way parameters work differently (`Sx` vs `NAME=x`) for gcode style commands vs Klipper extended ones, the rename has to be to the "same type" of command. `G28_BASE` does not fit the pattern to be considered a "gcode style" one. Use `G9028` or `G28.1` or something instead and it should work.


---

### Answer by username_1 on 2022-03-15. Score: 1

Besides using a different macro, it is also possible to use [[homing\_override]](https://www.klipper3d.org/Config_Reference.html#homing_override) which allows you to redefine the homing sequence.

You can write a simple homing\_override like (untested!)

```
[homing_override]
axes: xyz
gcode:
  M80
  G28

```

and you are done.

Be aware that this very simple override will home all axes every time homing is called: "G28 X0" will home also Y and Z. You can put checks to home only what is requested, see [here](https://github.com/zellneralex/klipper_config/blob/master/homing.cfg) but it become more involved.

> **Comments:**
> **username_0**: Thanks, I saw this. But I decided not to use this exactly because of the reason you mentioned: I'd like to be able to pass arguments as is to the default G28 implementation  
> **username_1**: If you check the link I provided, he homes only what's being requested by checking "{% if params.X is defined %}{% set home_x = True %}{% endif %}" and so on  

---

