     {nil, state}
   end
 
+  defp handle_gcode(:idle, %{initialized: true, initializing: false, current: nil, z_needs_home_on_boot: true} = state) do
+    Logger.info 2, "Bootup homing Z axis"
+    spawn __MODULE__, :home, [:z]
+    {nil, %{state | z_needs_home_on_boot: false}}
+  end
+
+  defp handle_gcode(:idle, %{initialized: true, initializing: false, current: nil, y_needs_home_on_boot: true} = state) do
+    Logger.info 2, "Bootup homing Y axis"
+    spawn __MODULE__, :home, [:y]
+    {nil, %{state | y_needs_home_on_boot: false}}
+  end
+
+  defp handle_gcode(:idle, %{initialized: true, initializing: false, current: nil, x_needs_home_on_boot: true} = state) do
+    Logger.info 2, "Bootup homing X axis"
+    spawn __MODULE__, :home, [:x]
+    {nil, %{state | x_needs_home_on_boot: false}}
+  end
+
   defp handle_gcode(:idle, state) do
     maybe_cancel_timer(state.timer, state.current)
     Farmbot.BotState.set_busy(false)


  defp maybe_update_param_from_report(param, val) when is_binary(param) do
    real_val = if val, do: (val / 1), else: nil
    Logger.debug 3, "Firmware reported #{param} => #{val || -1}"
    update_config_value(:float, "hardware_params", to_string(param), real_val)
  end



    case handler_mod.start_link() do
      {:ok, handler} ->
        initial = Map.merge(needs_home_on_boot(), %{handler: handler, handler_mod: handler_mod})
        Process.flag(:trap_exit, true)
        {
          :producer_consumer,
          struct(State, initial),
          subscribe_to: [handler], dispatcher: GenStage.BroadcastDispatcher
        }
      {:error, reason} ->
